A basic OpenLDAP server in under 15 minutes

categories:
- Debian/Ubuntu
- Howto
- LDAP

Tested under Debian Lenny

This howto is basic, as in "no security involved". I may come up with a second part to this guide about securing OpenLDAP with TLS, if I ever find the time.
Meanwhile see http://www.openldap.org/doc/admin23/security.html for the security aspect of things.

In this example, I'll create a tree following this scheme : dc=my,dc=domain,dc=tld.
It's really up to you how you organize your tree, it's really for organizational purposes. You can limit your tree to a single root branch, for example dc=myname.

Install OpenLDAP server and some useful utilities :

# apt-get install slapd ldap-utils

You should be prompted for a password, if not create it from the command line :

cd /etc/ldap/LDIF

You should be prompted for the admin password as much as you have LDIF files in the directory.
If you didn't name your file 1_base.ldif, 2_group.ldif, etc. the command may fail as it may try to add a group or user before creating its branch.