Now that you know how LDAP works, it's time to put it intopractice. In this article, find out how to compile, install and configurethe OpenLDAP software suite, create an LDAP directory for your organization,and add entries to it. Also included: a detailed discussion of how to searchthe database using both the UNIX client tools supplied with OpenLDAP, andthe LDAP client built into Qualcomm Eudora.
The first order of business to install OpenLDAP on your Linux box. Drop by the official Web site at http://www.openldap.org/ and get yourself the latest stable release of the software (this tutorial uses OpenLDAP 2.1.12). Note that you will also need a copy of the SleepyCat Berkeley DB database engine, available from http://www.sleepycat.com/ (this tutorial uses Berkeley DB 4.1.25)
Once you've downloaded the source code archive to your Linux box (mine is named "olympus"), log in as "root".
[me@olympus] $ su -
Password: ****
You'll first need to compile and install Berkeley DB. Extract the
source to a temporary directory.
[root@olympus] $ cd /tmp
[root@olympus] $ tar -xzvf db-4.1.25.tar.gz
Next, configure the package using the provided "configure" script,
[root@olympus] $ cd /tmp/db-4.1.25
[root@olympus] $ cd build_unix[root@olympus] $ ../dist/configure
and compile and install it.
[root@olympus] $ make
[root@olympus] $ make install
Unless you specified a different path to the "configure" script, Berkeley DB will have been installed to the directory "/usr/local/BerkeleyDB.4.1".
Next, you need to install the OpenLDAP software proper. Again, extract the source archive to a temporary directory.
[root@olympus] $ cd /tmp
[root@olympus] $ tar -xzvf openldap-stable-20030107.tar.gz
Next, configure the package using the provided "configure" script,
[root@olympus] $ cd /tmp/openldap-2.1.12
[root@olympus] $ ./configure --prefix=/usr/local/openldap
and compile and install it.
[root@olympus] $ make depend
[root@olympus] $ make
[root@olympus] $ make install
Since I specified a custom path to the "configure" script, OpenLDAP
will have been installed to the directory "/usr/local/openldap".
It must be noted that "configure" sometimes barfs when including the Berkeley DB library into OpenLDAP. In case you have this problem, explicitly tell "configure" where to find the files, as follows: