Monday, March 16, 2015

Installing OpenLDAP in Ubuntu

LDAP stands for Lightweight Directory access protocol. LDAP protocol is used to access Directory servers. Think of LDAP similar to SQL. In this post we will see how to install openLDAP which is a directory server and can be accessed using LDAP protocol. The steps are for Ubuntu boxes are as follows. This is tried on Ubuntu 1404.

Installation Steps

Update your server with latest


sudo apt-get update

Install the required packages

sudo apt-get install slapd ldap-utils

Configure the openLDAP server

sudo dpkg-reconfigure slapd

This will ask for default settings and the database to be used. Accept the defaults, if you do not want to change anything. The openLDAP server is automatically started which you can check by doing. A sample entry to the questions:

 If you enable this option, no initial configuration or database will   │  
  │ be created for you.                                                    │  
  │                                                                        │  
  │ Omit OpenLDAP server configuration?      - No

DNS domain name:   This is the domain controller. Usually people put their organization domain name. For example if I am doing it personally, I would put lalitbhatt.net

Organization name: Put your organizaation name.

Administrator password: Put your super secret string here. I remember a joke of a guy who always used to forget his password and would receive a message that 'Your password is incorrect'. So he resets all his passwords to incorrect.

Database backend to use: The recommendation is for HDB which you can read in the screen itself.

Do you want the database to be removed when slapd is purged? If you want to remove the old database select yes otherwise no.

Move old database? If you want to move say yes.

Allow LDAPv2 protocol? No

Check if ldap server is running

ps -ef|grep slapd

If the server is not started, you can do that with the following command

sudo service slapd restart

Installing phpldapadmin

For administrative interface you can install phpldapadmin

sudo apt-get install phpldapadmin

You can access the web interface using the url http://127.0.0.1/phpldapadmin

Login using the DN of your admin user and password. For example if the domain name is example.com and password is admin, you can login using the following credentials

Login DN: cn=admin,dc=example,dc=com
Password: admin

No comments:

Post a Comment