OpenLDAP on CentOS

Installation

For ldap server:

# yum install openldap openldap-servers

For ldap client:

# yum install openldap-clients

 

Configuration

Server configuration

The server configuration file is in  /etc/openldap/slapd.conf. References:

If you get the following error upon starting the ldap server, you can do so by copying /etc/openldap/DB_CONFIG.example to /var/lib/ldap/DB_CONFIG:

# /etc/init.d/ldap start
Checking configuration files for slapd:  bdb_db_open: Warning - No DB_CONFIG file found in directory /var/lib/ldap: (2)
Expect poor performance for suffix dc=example,dc=com.
config file testing succeeded

To fix the above error, start with the following:

# cp /etc/openldap/DB_CONFIG.example to /var/lib/ldap/DB_CONFIG

To start the LDAP server, run

# /etc/init.d/ldap start

And add it to auto start:

# chkconfig --add ldap

To switch to slapd.d from slapd.conf:

# cd /etc/openldap
# mkdir slapd.d
# /usr/sbin/slapindex -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d

# slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d

client configuration

The client configuration file is in  /etc/openldap/lapd.conf. References:

  • man lapd.conf

 

References