12.1. Installing OpenLDAP on Debian
Problem
You're ready to go to work and get your OpenLDAP server up and running. What's the best way to install it on Debian?
Solution
Just fire up Aptitude and install these packages:
#aptitude install slapd ldap-utils gq db4.3-doc db4.2-utilYou will be asked to create an LDAP admin password. Debian will then create the LDAP admin user, and take your existing domain name as the suffix, or naming context.
Then, run this simple search to make sure the server is running and responding to requests:
# ldapsearch -xb '' -s base '(objectclass=*)' namingContexts
[...]
dn:
namingContexts: dc=alrac,dc=net
[...]Run this command to show the admin user:
$ ldapsearch -xb 'dc=alrac,dc=net'
[...]
# admin, alrac.net
dn: cn=admin,dc=alrac,dc=net
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
[...]Very good! This shows success. Now, you are ready to move on to the next steps.
Discussion
Debian creates a bare-bones configuration, creates an openldap user, which you can see in /etc/passwd, creates startup files and starts it at boot, and gives all the files the correct ownership and permissions. It also creates the OpenLDAP admin user, which is not a system user like openldap, but a user in the OpenLDAP directory.
You've probably seen OpenLDAP How-tos that create a rootdn and rootpw in
slapd.conf. The rootdn is the database superuser, just like
our admin user, and rootpw is the rootdn's password. This is necessary ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access