4.1. Notes for users
If you are reading this version of the OpenLDAP Administrator's Guide, it means you have installed the OpenLDAP documentation package.
4.1.1. File locations
The blackPanther packages install OpenLDAP with a prefix of /usr, so the daemons are availble in /usr/sbin, client utilities in /usr/bin, configuration files under /etc/openldap, libraries in /usr/lib (or /usr/lib64 on 64bit platforms), and plugins for slapd under /usr/lib/openldap. The packages are built with all useable backends and overlays (many as loadable modules), so it should normally not be necessary to build from source.
The OpenLDAP test suite that is shipped with the source code is also shipped, ready-to-run, in the openldap-tests package. To run the test suite (to confirm that all tests passed, investigate some of the example configurations that are shipped, etc.), simply install openldap-tests (with urpmi openldap-tests) then (as any user):
-
cd /usr/share/openldap/tests
make tests
4.1.2. Upgrading between major versions of OpenLDAP when upgrading the distribution
Upgrades between major versions should usually proceed cleanly without user intervention, and work as follows:
- Before package installation, for each database defined in /etc/openldap/slapd.conf and any first level included files
- If no file named rpm-migrate-to-<OPENLDAP-MAJOR-VERSION>.ldif-imported or rpm-migrate-to-<OPENLDAP-MAJOR-VERSION>.ldif-import-failed exists in the database directory
- the database will be dumped (using slapcat) to the file rpm-migrate-to-<OPENLDAP-MAJOR-VERSION>.ldif in the database directory
- After package installation, for each database defined in /etc/openldap/slapd.conf or any first level included files
- If a file with the name rpm-migrate-to-<OPENLDAP-MAJOR-VERSION>.ldif exists, it will be imported using slapadd.
- If the import succeeds, this file will be renamed to rpm-migrate-to-<OPENLDAP-MAJOR-VERSION>.ldif-imported
- If the import fails, the file will be renamed to rpm-migrate-to-<OPENLDAP-MAJOR-VERSION>.ldif-import-failed
Thus, under normal circumstances, each database should be migrated successfully, leaving a file (which could be quite large) named rpm-migrate-to-<OPENLDAP-MAJOR-VERSION>.ldif-imported in each database directory. If you are happy that migration worked successfully and you wish to reclaim the disk space, make this file an empty file (ie > rpm-migrate-to-<OPENLDAP-MAJOR-VERSION>.ldif-imported). If import fails, you should be left with complete LDIF for each database.
If the export of the database fails, then you may need to use a compatability package matching your previous OpenLDAP package to export your data. This will require some work (mainly copying your usual slapd.conf to the configuration directory for the compatability version), so even though upgrades should work cleanly, it is recommended to stop slapd and take an ldif backup manually for each database before upgrading.
If you would prefer to handle all database upgrading yourself, you can disable automatic migration by setting AUTOMIGRATE=no in your /etc/sysconfig/slapd
4.1.3. Other versions of OpenLDAP
The OpenLDAP packages are usually up-to-date at the time of version freeze in the distribution. The distribution security update policy means that updates for OpenLDAP packages will only be provided in the event of a security vulnerability, and will only address the specific vulnerability (new versions will not be provided, the original version will be patched).
As a service to users who prefer to run more up-to-date versions of OpenLDAP software, the maintainer often provides newer (ie versions not yet marked as stable) versions in the contrib repository that can be installed in parallel, and usually attempts to ensure that the packages rebuild correctly (maintaining their status as they were on the original distribution) on older distributions. However, these packages cannot be supported.
Compatability packages are kept in contrib for at least one release after they have been replaced in main by a new version (to ensure that users for whom automatic migration failed can export their data with a slapcat compatible with their data. The BerkeleyDB version that the package used when in main is maintained, even if this means retaining an internal copy.
All the files/commands/man pages and OpenLDAP-specific directories (ie /usr/lib/openldap, /etc/openldap) are suffixed with the major version of the software, for instance the slapd daemon would be called slapd2.2 and would use the configuration file /etc/openldap2.2/slapd.conf and plugins from /usr/lib/openldap2.2).
4.1.4. Skip Ahead
The rest of this chapter may be skipped if the version you require is available and can be installed with urpmi or the Software Installer. Continue on to Configuring slapd.
4.2. Obtaining and Extracting the Software
You can obtain OpenLDAP Software from the project's download page at http://www.openldap.org/software/download/ or directly from the project's
The project makes available two series of packages for general use. The project makes releases as new features and bug fixes come available. Though the project takes steps to improve stability of these releases, it is common for problems to arise only after release. The stable release is the latest release which has demonstrated stability through general use.
Users of OpenLDAP Software can choose, depending on their desire for the latest features versus demonstrated stability, the most appropriate series to install.
After downloading OpenLDAP Software, you need to extract the distribution from the compressed archive file and change your working directory to the top directory of the distribution:
-
gunzip -c openldap-VERSION.tgz | tar xf -
cd openldap-VERSION
You'll have to replace VERSION with the version name of the release.
You should now review the COPYRIGHT, LICENSE, README and INSTALL documents provided with the distribution. The COPYRIGHT and LICENSE provide information on acceptable use, copying, and limitation of warranty of OpenLDAP Software. The README and INSTALL documents provide detailed information on prerequisite software and installation procedures.
4.3. Prerequisite software
OpenLDAP Software relies upon a number of software packages distributed by third parties. Depending on the features you intend to use, you may have to download and install a number of additional software packages. This section details commonly needed third party software packages you might have to install. However, for an up-to-date prerequisite information, the README document should be consulted. Note that some of these third party packages may depend on additional software packages. Install each package per the installation instructions provided with it.
4.3.1. Transport Layer Security
OpenLDAP clients and servers require installation of OpenSSL or GnuTLS
OpenSSL is available from http://www.openssl.org/. GnuTLS is available from http://www.gnu.org/software/gnutls/.
OpenLDAP Software will not be fully LDAPv3 compliant unless OpenLDAP's configure detects a usable TLS library.
4.3.2. Simple Authentication and Security Layer
OpenLDAP clients and servers require installation of Cyrus SASL libraries to provide
Cyrus SASL is available from http://asg.web.cmu.edu/sasl/sasl-library.html. Cyrus SASL will make use of OpenSSL and Kerberos/GSSAPI libraries if preinstalled.
OpenLDAP Software will not be fully LDAPv3 compliant unless OpenLDAP's configure detects a usable Cyrus SASL installation.
4.3.3. Kerberos Authentication Service
OpenLDAP clients and servers support
Heimdal Kerberos is available from https://github.com/heimdal/heimdal/. MIT Kerberos is available from http://web.mit.edu/kerberos/www/.
Use of strong authentication services, such as those provided by Kerberos, is highly recommended.
4.3.4. Database Software
OpenLDAP's slapd(8)
4.3.5. Threads
OpenLDAP is designed to take advantage of threads. OpenLDAP supports POSIX pthreads, NT threads and a number of other varieties. configure will complain if it cannot find a suitable thread subsystem. If this occurs, please consult the Software|Installation|Platform Hints section of the OpenLDAP FAQ http://www.openldap.org/faq/.
4.3.6. TCP Wrappers
slapd(8) supports TCP Wrappers (IP level access control filters) if preinstalled. Use of TCP Wrappers or other IP-level access filters (such as those provided by an IP-level firewall) is recommended for servers containing non-public information.
4.4. Running configure
Now you should probably run the configure script with the --help option. This will give you a list of options that you can change when building OpenLDAP. Many of the features of OpenLDAP can be enabled or disabled using this method.
./configure --help
The configure script also looks for certain variables on the command line and in the environment. These include:
Variable | Description |
CC | Specify alternative C Compiler |
CFLAGS | Specify additional compiler flags |
CPPFLAGS | Specify C Preprocessor flags |
LDFLAGS | Specify linker flags |
LIBS | Specify additional libraries |
Now run the configure script with any desired configuration options or variables.
./configure [options] [variable=value ...]
As an example, let's assume that we want to install OpenLDAP with MDB backend and TCP Wrappers support. By default, MDB is enabled and TCP Wrappers is not. So, we just need to specify --enable-wrappers to include TCP Wrappers support:
./configure --enable-wrappers
However, this will fail to locate dependent software not installed in system directories. For example, if TCP Wrappers headers and libraries are installed in /usr/local/include and /usr/local/lib respectively, the configure script should typically be called as follows:
./configure --enable-wrappers \ CPPFLAGS="-I/usr/local/include" \ LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
The configure script will normally auto-detect appropriate settings. If you have problems at this stage, consult any platform specific hints and check your configure options, if any.
4.5. Building the Software
Once you have run the configure script the last line of output should be:
Please "make depend" to build dependencies
If the last line of output does not match, configure has failed, and you will need to review its output to determine what went wrong. You should not proceed until configure completes successfully.
To build dependencies, run:
make depend
Now build the software, this step will actually compile OpenLDAP.
make
You should examine the output of this command carefully to make sure everything is built correctly. Note that this command builds the LDAP libraries and associated clients as well as slapd(8).
4.6. Testing the Software
Once the software has been properly configured and successfully made, you should run the test suite to verify the build.
make test
Tests which apply to your configuration will run and they should pass. Some tests, such as the replication test, may be skipped if not supported by your configuration.
4.7. Installing the Software
Once you have successfully tested the software, you are ready to install it. You will need to have write permission to the installation directories you specified when you ran configure. By default OpenLDAP Software is installed in /usr/local. If you changed this setting with the --prefix configure option, it will be installed in the location you provided.
Typically, the installation requires super-user privileges. From the top level OpenLDAP source directory, type:
su root -c 'make install'
and enter the appropriate password when requested.
You should examine the output of this command carefully to make sure everything is installed correctly. You will find the configuration files for slapd(8) in /usr/local/etc/openldap by default. See the chapter Configuring slapd for additional information.