mail us  |  mail this page

contact us
training  | 
tech stuff  | 

Running OpenLDAP

Some notes on running OpenLDAP under various releases.

Version 2.4

This documents some experiences using 2.4.7 on FreeBSD (5.x and 6.x). While the locations may change the basic principles should remain the same for Linux. The following lists what you may have to do to get OpenLDAP running. The notes also include some diagnostic aids and procedures:

  1. The following is a quick checklist of what you have to do before starting OpenLDAP. Most of this stuff is manual. Some of it is obvious, some not:

    1. Configure log streaming (/etc/syslog.conf) for OpenLDAP (see notes under loglevel).

    2. configure/move/create slapd.conf to a suitable location ([fc] /etc/openldap [bsd] /usr/local/etc/openldap)

    3. Make sure all directories and files exist and have appropriate permissions (pid file locations, database directories). Copy the DB_CONFIG.example file to the DIT directory directive location(s) and rename as DB_CONFIG - it contains enough to get you going.

    4. Recent distributions of OpenLDAP all use scripts that run it with a non-root user and group (typically ldap) following current practise. Permissions for this user and group may be need manual adjustments for all non-standard locations. While permission problems may be avoided by running as user root this is not good practise. Instead use the -d option to debug failing permission problems and rectify them.

    5. FreeBSD: scripts assume the PID file is in /var/run/openldap/ - scripts do not read the slapd.conf file so if using a non-standard location edit the script or change the pidfile directive otherwise the termination script will not work since it is looking in the wrong location for the pid.

    6. When running 2.4.7 and an empty database BDB fails to initialize if using slaptest to verify the slapd.conf:

      # fails with missing id2entry.bdb
      # try to verify slapd.conf only 
      slaptest -u
      # inhibits database checking
      # then try a normal load of LDAP using root
      # 1. make sure database directory exists
      # 2. make sure DB_CONFIG exists in target directory
      slapd -d -1
      # adjust permissions to ldap user and restart
      slapd -d -1 -u ldap -g ldap
      # once this is working 
      # either use normal start script or
      slapd -u ldap -g ldap

      If all this fails - install a 2.3 version of OpenLDAP and repeat process. Once the database files exist - re-install 2.4.

    7. If slapd fails - run it in diagnostic mode from command line using:

      [bsd]/usr/local/libexec/slapd -d -1 -u ldap -g ldap
      # displays all failures on terminal

Up Arrow

Problems, comments, suggestions, corrections (including broken links) or something to add? Please take the time from a busy life to 'mail us' (at top of screen), the webmaster (below) or info-support at zytrax. You will have a warm inner glow for the rest of the day.


tech info
guides home
1 objectives
big picture
2 concepts
3 ldap objects
4 install ldap
5 samples
6 configuration
7 replica & refer
8 ldif
9 protocol
10 ldap api
11 howtos
12 trouble
13 performance
14 ldap tools
15 security
notes & info
ldap resources
rfc's & x.500
ldap objects
change log

Creative Commons License
This work is licensed under a Creative Commons License.

If you are happy it's OK - but your browser is giving a less than optimal experience on our site. You could, at no charge, upgrade to a W3C STANDARDS COMPLIANT browser such as Firefox




Icons made by Icomoon from is licensed by CC 3.0 BY
share page via facebook tweet this page


email us Send to a friend feature print this page Display full width page Decrease font size Increase font size



Debian Linux


GNU-Free SW Foundation


Open Source Initiative
Creative Commons


Ibiblio - Library
Open Book Project
Open Directory


CSS Technology SPF Record Conformant Domain
Copyright © 1994 - 2024 ZyTrax, Inc.
All rights reserved. Legal and Privacy
site by zytrax
hosted by
web-master at zytrax
Page modified: January 20 2022.