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 http://www.sleepycat.com/download/index.shtml
gzip -d db-4.7.25.tar.gz
tar xvf db-4.7.25.tar
Installing TSL(I install openSSL)
Download the compatible version of OpenSSL from http://www.openssl.org/source/
gzip –d openssl-version.tar.gz
tar xfv openssl-version.tar
./config shared –openssldir=/usr/local
Download the particular version of openLDAP from http://www.openldap.org/software/download/
gzip -d openldap-version.tgz
tar xfv openldap-version.tar
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: libdb-4.8.so: cannot open shared object file: No such file or directory
If so enter the following command or add it to bash_profile.
Stop the server: kill -INT `cat /usr/local/var/run/slapd.pid`
To check whether the server is correctly configured and running use ldapserch as follows.
ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts