Pokazywanie postów oznaczonych etykietą apache. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą apache. Pokaż wszystkie posty

piątek, 18 lutego 2011

Ubuntu: apt-get - how to install already installed package

Let's imagine a case where one has been removed by chance some files comes with one of deb packages installed with apt-get utility.

For sake of this example lets remove /usr/lib/php5/20060613/pdo_mysql.so file.

Now after Apache restart the following entry will appear in /var/log/apache2/error.log
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/pdo_mysql.so' 
- /usr/lib/php5/20060613/pdo_mysql.so: cannot open shared object file: 
No such file or directory in Unknown on line 0

In this particular case is quite easy to guess which package pdo_mysql.so file comes with. But in general dpkg --search can help.

$ dpkg --search /usr/lib/php5/20060613/pdo_mysql.so
php5-mysql: /usr/lib/php5/20060613/pdo_mysql.so

Now we know for sure which packed needs to be installed again. To ask apt-get to install package which already is installed --reinstall option needs to be used.

sudo apt-get --reinstall install php5-mysql

Now pdo_mysql.so should be again on its place.

piątek, 28 maja 2010

How to setup Trac for LDAP authentication

First all of I'd like mentioned i'm not Apache master thus do not take responsibility for potential damages whilst following this tutor. But don't be afraid nothing wrong should happen ;).

But to the point. When we decide to install Trac as Apache/httpd application it comes with some basic authentication based on unix password. The following is typical configuration:

<virtualHost *:80>

  ServerName trac.example.com

  <location />
    SetHandler mod_python
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnv /var/www/trac
    PythonOption TracUriRoot /
  </location>
  <location "/login">
    AuthType Basic
    AuthName "trac"
    AuthUserFile /var/www/trac/auth-file
    Require valid-user
  </location>

</virtualHost>

For switching to LDAP authentication use following:

<virtualhost *:80 >

 ServerName trac.example.com

 <location />
  SetHandler mod_python
  PythonHandler trac.web.modpython_frontend
  PythonOption TracEnv /var/www/trac
  PythonOption TracUriRoot /
 </location>

 <location "/login" >
   AuthType Basic
   AuthBasicProvider ldap
   AuthzLDAPAuthoritative off
   AuthLDAPBindDN "DOMAIN\\BINDUSER"
   AuthLDAPBindPassword PASSWORD
   AuthLDAPUrl LDAPUTL
   AuthName "Authorization required"
   Require valid-user
 </location>

</VirtualHost>


BindDN - the Distinguished Name binddn to bind to the LDAP directory

DOMAIN - name of the domain
BINDUSER - special bind user for accessing non-public data
PASSWORD - password for BINDUSER
LDAPURL - ldap://HOST:389/SEARCHBASE?sAMAccountName?sub

SEARCHBASE - the starting point for the search

The following command can be used to test your LDAP connection:

ldapsearch -h HOST -b "SEARCHBASE" -D "DOMAIN\\BINDUSER" -s sub -x -w PASSWORD "(givenName=K*)"