Revision of phpLDAPadmin from Tue, 06/02/2009 - 17:02

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

phpLDAPadmin is a web-based LDAP browser to manage your LDAP server.

Prerequisites

  • PHP needs to have been compiled with gettext and LDAP support( "--with-ldap --with-gettext")
  • If the web interface squawks about date.timezone, then you need to edit /usr/local/lib/php.ini and add a default timezone line (such as date.timezone ="America/Thunder_Bay").

Installation
Make a directory to hold the website files:

mkdir -p /var/websites/private/htdocs
mkdir -p /var/websites/private/logs

Download the latest version of phpldapadmin (1.1.0.7 at time of writing):

cd /extra/src
wget http://internap.dl.sourceforge.net/sourceforge/phpldapadmin/phpldapadmin-1.1.0.7.tar.gz
tar zxvf phpldapadmin-1.1.0.7.tar.gz

Move the extracted files to your website htdocs root:

mv phpldapadmin-1.1.0.7 /var/websites/private/htdocs/phpldapadmin
cd /var/websites/private/htdocs/phpldapadmin/config
cp config.php.example config.php

Server configuration
Edit /var/websites/private/htdocs/config/config.php to add your LDAP server to phpldapadmin.
Find the following line and change "My LDAP Server" to something more descriptive for your LDAP server:

$ldapservers->SetValue($i,'server','name','My LDAP Server');

Assuming you are running that server on the same machine that is running phpldapadmin, add host and port lines:

$ldapservers->SetValue($i,'server','host','127.0.0.1');
$ldapservers->SetValue($i,'server','port','389');

Add a line for default login information:

$ldapservers->SetValue($i,'login','dn','cn=Manager,dc=example,dc=com');

Apache VirtualHost
Edit /usr/local/apache2/conf/httpd.conf and add a non-standard port for it to listen on (maximum allowed is 65535):

Listen 12345

Edit /usr/local/apache2/conf/extra/httpd-vhosts.conf and add a virtual host directive:

<VirtualHost _default_:12345>
  DocumentRoot /var/websites/private/htdocs

  <Directory /var/websites/private/htdocs>
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

  ErrorLog /var/websites/private/logs/private-error_log
  CustomLog /var/websites/private/logs/private-access_log combined
</VirtualHost>

Restart Apache:

svc -t /service/apache

Password protect /phpldapadmin

Require a password to access to /phpldapadmin, by editing /usr/local/apache2/conf/extra/httpd-ssl.conf and add a directive for our phpldapadmin directory:

<Directory "/var/websites/private/htdocs/phpldapadmin">
  Order Allow,Deny
  Allow from all

  AuthType Basic
  AuthName phpldapadmin
  # You can use the htpass program to create the password database:
  #   htpasswd -c "/var/websites/private/phpldapadmin.passwd" admin
  AuthUserFile "/usr/local/apache2/conf/phpldapadmin.passwd"

  # Block access except for authenticated users
  require valid-user
</Directory>

Restart Apache:

svc -t /service/apache

Create the htpasswd file:

/usr/local/apache2/bin/htpasswd -c /var/websites/private/phpldapadmin.passwd admin

Recent Updates

  • 8 months 3 weeks ago
    1.27.2 update
  • 9 months 4 days ago
    Drupal 10/11 config
  • 9 months 5 days ago
  • PHP
    9 months 6 days ago
    PHP 8.3.11 and AlmaLinux
  • 9 months 6 days ago
    New version of Pound