Skip to main content
openLDAPUbuntu

Installing the openLDAP Server on Natty Narwal, Ubuntu 11.04

By April 17, 2013September 12th, 2022No Comments

My original openLDAP videos have been well received but I have a had a few requests to show the setup and configuration of openLDAP on Ubuntu , so here goes. The nice thing is that openLDAP is openLDAP so it is basically the same. I think some folks may go wrong as some of the Ubuntu Docs to do this are not up to date. The installation of the openLDAP server does the basic setup for you. Make sure that your host name is set correctly before you install openLDAP. What I mean is that you have a domain-name as part of your hostname.

We install the slapd and ldap-utils.

sudo apt-get -y install slapd ldap-utils

At the end of the install upstart will then contact the ldap server and prompt for an admin password. This is then creating you basic configuration. My hostname is natty.tup.com, so an ldap database will be created for dc=tup,dc=com, the admin password I entered in during the install would be the user cn=admin,dc=tup,dc=com. The default schema and modules are precreated for you too, so all we need to do is create the OUs that we would normally want.

structure.ldif

dn: ou=people,dc=tup,dc=com
objectClass: organizationalUnit
ou: people 

dn:  ou=groups,dc=tup,dc=com
objectClass: organizationalUnit
ou: groups

We then need to import this using the admin name and password entered when we installed openLDAP.

ldapadd -W -D cn=admin,dc=tup,dc-com -f /tmp/structure.ldif

Quite a lot less than the Ubuntu docs! The video shows you how easy it is.