Basic LDAP Installation

Introduction

This post is based on Debian 7.8 The server should have a static IP address configured by a DHCP server and not manually set in the LDAP interface configurations. I use 192.168.20.5 as my IP address and my domain is “kirk”. Server has a really unoriginal hostname as LDAP. Normally I should not use root when working with a server but have done so here instead of using sudo. It should be able to used for Ubuntu servers as well.

Install OpenLDAP

Installing  OpenLDAP is as follows:

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

A small configuration starts where it will prompt for creation of a Administrator password. Add one and confirm it.

The ldap software is now install on the system

OpenLDAP Configuration

Configuration is in 2 parts.

  1. edit of the ldap.conf file
  2. reconfiguration of the dpkg slapd

First I will edit the configuration file to make the OpenLDAP server match my setup.

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

In my case hostname was ldap.kirk I have no public domain so my dc=kirk and no more.
Save and restart the slapd service

service slapd restart

Run the “dpkg-reconfigure slapd” reconfigure the LDAP package.

dpkg-reconfigure slapd

It will prompt for some question and for my network it is as followed:

Skærmbillede 2015-03-21 13.14.51
I selected No:

Skærmbillede 2015-03-21 13.39.03
Select Ok:

It will automated add my local domain that the server has received from the DHCP server. The same goes for the Organization Unite.
Skærmbillede 2015-03-21 13.39.15
Give an administrative password, and confirm.

Skærmbillede 2015-03-21 13.40.51
Skærmbillede 2015-03-21 13.39.42
I chose the default HDB database based on the configuration recommendation.
Skærmbillede 2015-03-21 13.39.53
I did choose not to delete the db when purged
Skærmbillede 2015-03-21 13.40.13
Select Yes and move the old database files.
Skærmbillede 2015-03-21 13.40.20
I don’t want to use LDAPv2 protocol so I selected No.

LDAP Test

Now to check if the configuration is gone wall:

ldapsearch -x

Skærmbillede 2015-03-21 13.58.57A successful configuration for the OpenLDAP server.

Next LDAP Posts

One thought on “Basic LDAP Installation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.