Building OpenLDAP Server on Cygwin

Prerequisites

Configure the PATH environment variable includes the following directories:

  • JAVA_HOME/bin
  • JAVA_HOME/jre/bin/server

Install Cygwin with the following packages:

  • cyrus-sasl (optional)
  • gcc
  • libdb4.3-devel
  • libtool
  • make
  • openssl
  • openssl-devel
  • patch

Installing OpenLDAP Source Code

Install the following Cygwin package:

  • openldap 2.2.26 (source only)

Then execute:

cd /usr/src
./openldap-2.2.26-2.sh prep

The source code will be installed in /usr/src/openldap-2.2.26. We will refer this directory as OPENLDAP_SRC.

Patching OpenLDAP

Apply the patch:

cd JAVA_BACKEND_HOME
ant -Dopenldap.src=... -Dopenldap.version=... patch

The "openldap.src" should point to OPENLDAP_SRC. The "openldap.version" should be the version number, e.g. 2.2.26.

Building OpenLDAP

Run the following command to configure OpenLDAP with Java Backend.

cd OPENLDAP_SRC
./configure --enable-java [other options]

Run the following command to build OpenLDAP:

make depend
make

Installing OpenLDAP

Run the following command to install OpenLDAP:

make install

By default the slapd will be installed under /usr/local/libexec directory, the module (back_java.la) will be installed under /usr/local/libexec/openldap, and the slapd.conf will be installed under /usr/local/etc/openldap.

To run slapd:

cd /usr/local/libexec
./slapd -d 65535