Debian Squeeze LDAP Server With OpenLDAP And phpLDAPadmin
This tutorial will show you how you can set up an LDAP and webinterface to manage the LDAP server on Debian Squeeze.
phpLDAPadmin url: http://phpldapadmin.sourceforge.net/wiki/index.php/Main_Page
See screenshots of phpLDAP admin here: http://sourceforge.net/projects/phpldapadmin/
Server name: ldap.example.com
Domain name: example.com
Server IP: 192.168.0.2
Now we want to make sure the server is up to date:
apt-get update
apt-get upgrade
First we install slapd and create a password for administrator:
apt-get install slapd
When prompted enter a password for the administrator of the LDAP server, I choose the password passw0rd in this example.
Now we need to install ldap-utils and phpLDAPadmin, now apache2 and php will also be installed because it's a part of the dependencies for phpLDAPadmin.
apt-get install ldap-utils phpldapadmin
Open /etc/ldap/ldap.conf with your editor, e.g. nano:
nano /etc/ldap/ldap.conf
and uncomment BASE and URI and edit so it looks like this:
#
# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
BASE dc=example,dc=com
URI ldap://127.0.0.1
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
If you want to edit domain name I recommend to run following command:
dpkg-reconfigure slapd
Select NO and follow the guide, type in your domain, e.g. example.com, choose recommend settings.
Now open /etc/phpldapadmin/config.php:
$servers = new Datastore();
$servers->newServer('ldap_pla');
$servers->setValue('server','name','My LDAP Server');
$servers->setValue('server','host','192.168.0.2');
$servers->setValue('server','port',389);
$servers->setValue('server','base',array('dc=example,dc=com'));
$servers->setValue('login','bind_id','cn=admin,dc=example,dc=com');
Your server is now up and running, ready to be used. and you should be able to access phpLDAPadmin on http://192.168.0.2/phpldapadmin; log in with following password passw0rd
You should also read this page if you like me have problems creating posix groups + users: