Installing and configuring LDAP and phpldapadmin

This will be a minimal setup. It’s a good idea to start by doing an update and upgrade on your system. In debian, use:

apt-get update && apt-get upgrade

Install the packages (set and confirm admin password)

apt-get install slapd ldap-utils phpldapadmin

Then vim /etc/ldap/ldap.conf and include:

BASE dc=example,dc=net
URI ldap://127.0.0.1

Then reconfigure (select “no” and then go with the default options)

dpkg-reconfigure slapd

Now to some customization, vim /etc/phpldapadmin/config.php and edit the values as you like

$servers->setValue('server','name','example.net LDAP');
$servers->setValue('server','base',array('dc=example,dc=net'));
$servers->setValue('login','bind_id','cn=admin,dc=example,dc=net');

Now login to your LDAP server by visiting example.com/phpldapadmin. To create some groups, click on “create a new entry” and select “Generic: Organisational Unit”. Choose the name (like “groups”) and commit.

Then you can add the groups itself by creating a “Generic: Posix Group” inside the “groups”. Repeat this process as many times you need (for groups “admins”, “staff”, “users”, etc). Pay attention so not to create further child entries if that’s not your intention, so you might need to click on the “refresh” icon and “Create new entry here”.

To hold the users you can create a new “Generic: Organisational Unit” entry on the same level as “groups”, named for instance “users”. Inside it, you create entries of type “Generic: User Account” to each user.

Leave a Reply

Your email address will not be published. Required fields are marked *

Loading Facebook Comments ...
Loading Disqus Comments ...