Debian Squeeze LDAP Server With OpenLDAP And phpLDAPadmin

Want to support HowtoForge? Become a subscriber!
 
Submitted by ressel (Contact Author) (Forums) on Wed, 2012-12-19 17:38. :: Debian

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:

http://wiki.debian.org/PhpLdapAdmin


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Tue, 2013-02-26 14:29.
clean and straightforward, very nice, dont listen to those "you didnt solve my specific problem" comments
Submitted by Anonymous (not registered) on Sat, 2013-01-05 23:19.
Would be nice a Debian Sqeeuze Howto about OpenLDAP with Kerberos & Samba primair domain controller.
Submitted by Raymond Pettersen (not registered) on Thu, 2012-12-20 23:17.
Extend this guide to something decent, or drop it. Atleast include some ldiff examples on how to create base, groups, and users.