20090525 building openldap on ubuntu from source - plembo/onemoretech GitHub Wiki

title: Building OpenLDAP on Ubuntu from source link: https://onemoretech.wordpress.com/2009/05/25/building-openldap-on-ubuntu-from-source/ author: lembobro description: post_id: 317 created: 2009/05/25 19:34:40 created_gmt: 2009/05/25 19:34:40 comment_status: open post_name: building-openldap-on-ubuntu-from-source status: publish post_type: post

Building OpenLDAP on Ubuntu from source

Building OpenLDAP from source is something I’ve done many times over the years. “Making” it happen on Ubuntu took a little effort, but in the end it wasn’t a really big deal.

The base O/S was Ubuntu 8.10 for this exercise.

Here’s the short version:

1. Download and unarchive the latest source from OpenLDAP project site. At this writing that’s 2.4.16, which contains a ton of bug fixes that makes the previous stable release, 2.4.11 (the version Ubuntu’s own somewhat crippled slapd package is built with), not worth the effort.

2. Make sure that libdb4.7-dev is installed. This is development package for Berkeley DB 4.7, whose headers are needed to compile the slapd database. If you want SSL/TLS and/or SASL, you’ll also need to install the libssl-dev and libsasl2-dev packages.

3. In order to avoid errors resulting from the particular glibc package used by Ubuntu, make the following change to the environment of the user that will do the build:

export CPPFLAGS=-D_GNU_SOURCE

3. Run the configure script at the root of the unarchived package. Like this:

./configure --prefix=/opt/openldap

The “–prefix” parameter to locate the final installation in the directory indicated.

4. Now do a “make depend” and then a “make”.

5. Finally, do a “make install”.

6. Re-permission to give ownership to the user and group that will run the server (e.g. openldap:openldap).

7. Even before testing, I usually use slaptest to test the config file (slapd.conf), and then do a slapadd to put some data in the database.

8. Test by simply running slapd in the final install directory (it will be under the libexec folder), like this:

/opt/openldap/libexec/slapd --d 16383 -h 'openldap:///' -g openldap -u openldap -4

This will start slapd as an application with full debugging turned on.

Copyright 2004-2019 Phil Lembo