OpenLDAP installation and configuration.

In the openLDAP installation and configuration README I followed they were asked to install the latest version of Berkely DB. At the moment I was installing it was 4.8.26 but after installing it I was unable to up the server. [ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1) ] error was appeared. Finally I found the reason and it worked for me. In the LDAP release notes it is stated that the most stable version of Berkely DB for openldap_2.4.21 is db-4.7.25. Then I install this version and reconfigure the LDAP server. It worked fine. Here are the full steps that I have followed. I installed it on top of the SSL.

Installing Berkely db-4.7.25.

Download the compatible version (for your particular LDAP version) of Berkeley DB f rom

  1. gzip -d db-4.7.25.tar.gz

  2. tar xvf db-4.7.25.tar

  3. cd db-4.7.25

  4. ../dist/configure –prefix=/usr/local/

  5. make

  6. make install

Installing TSL(I install openSSL)

Download the compatible version of OpenSSL from

  1. gzip –d openssl-version.tar.gz

  2. tar xfv openssl-version.tar

  3. cd openssl-version

  4. ./config shared –openssldir=/usr/local

  5. make

  6. make install

Installating openLDAP

Download the particular version of openLDAP from

gzip -d openldap-version.tgz

    1. tar xfv openldap-version.tar

    2. cd openldap-version

    3. ./configure

    4. make depend

    5. make

    6. make install

Now we should be able to up and run the LDAP server successfully.

Start the server: /usr/local/libexec/slapd

NOTE: (possible error at this point) :/usr/local/libexec/slapd: error while loading sharedlibraries: cannot open shared object file: No such file or directory

If so enter the following command or add it to bash_profile.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/

Stop the server: kill -INT `cat /usr/local/var/run/`

To check whether the server is correctly configured and running use ldapserch as follows.

ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts


Amila Silva said…
thanks this works fine

Popular posts from this blog

PostgreSQL bytea and oid

MySQL as Hive metadata store

Microservices Architecture with Spring Boot in 15mins