← TUTORIAL
#ldap

Basic LDAP Installation

updated 22 March 2015

This guide covers OpenLDAP installation and initial configuration on Debian 7.8. The server uses a static IP assigned by DHCP (192.168.20.5), the domain is kirk, and the hostname is ldap. Commands run as root.

Install OpenLDAP

apt-get update
apt-get install slapd ldap-utils

The installer prompts for an administrator password. Enter one and confirm it.

OpenLDAP Configuration

Configuration has two parts:

  • Edit /etc/ldap/ldap.conf
  • Reconfigure the slapd package with dpkg-reconfigure

Edit ldap.conf

nano /etc/ldap/ldap.conf
# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.

BASE    dc=kirk
URI     ldap://192.168.20.5

#SIZELIMIT 12
#TIMELIMIT 15
#DEREF    never

# TLS certificates (needed for GnuTLS)
TLS_CACERT  /etc/ssl/certs/ca-certificates.crt

The hostname in this setup is ldap.kirk. With no public domain, dc=kirk is sufficient. Save the file, then restart slapd:

service slapd restart

Reconfigure slapd

dpkg-reconfigure slapd

The reconfiguration wizard asks several questions. Here is how each prompt was answered for this setup.

Omit OpenLDAP server configuration? Select No:

Skærmbillede 2015-03-21 13.14.51

DNS domain name prompt, select Ok. The wizard fills in the local domain received from DHCP. The same applies to the Organization Unit:

Skærmbillede 2015-03-21 13.39.03

Skærmbillede 2015-03-21 13.39.15

Enter an administrative password and confirm it:

Skærmbillede 2015-03-21 13.40.51

Skærmbillede 2015-03-21 13.39.42

Choose the default HDB database:

Skærmbillede 2015-03-21 13.39.53

Keep the database when slapd is purged? Select No:

Skærmbillede 2015-03-21 13.40.13

Move old database files? Select Yes:

Skærmbillede 2015-03-21 13.40.20

Allow LDAPv2 protocol? Select No.

LDAP Test

Verify the configuration:

ldapsearch -x

Skærmbillede 2015-03-21 13.58.57

A successful result confirms the OpenLDAP server is running. Next steps in this series:

  • Creating users
  • Installing GOsa for easy management