Daily Archives: February 4, 2009

Most enterprises use LDAP as interface to their company structure database. In the Microsoft world is Active Directory the implementation for LDAP. Under Linux is OpenLDAP the common choice for admins. Such LDAP directories are tree based. OpenLDAP is the reference implementation for LDAP v3.

The JNDI API inside the Java SDK is usable as implementation to access such LDAP directories. With Spring LDAP is more sophisticated API available.

My first code sample works in the company against their OpenLDAP server. For security reasons is the access not possible from outside. So my JUNIT Tests was code red after running in my homeoffice. Maven standard is to run all test prior to build a package like a J2EE war or ear file. So i decided to setup a OpenLDAP server inside my ubuntu 8.10 server vmware server vm.

First step is to retrieve and install the openldap package as root:

sudo su –

apt-get install slapd ldap-utils nmap php5-ldap db4.2-util

You have to set a password during installation for the OpenLDAP server. Keep that in mind!
Now run the configuration assistant:

dpkg-reconfigure slapd

Wizard steps:

omit openldap server configuration? – no

dns domain name? vm.example.org

organization name? myCompany

database backend to use? hdb

do you want the database to be removed when slapd is purged? yes

may be the question: move old database? yes

administrator password? the same one as entered during installation

confirm password? see last step

allow LDAPv2 protocol? no

Now edit the /etc/ldap/ldap.conf file for the client side configuration: