Installation et configuration d'OpenLDAP

Installation

 aptitude install slapd ldap-utils 

Configuration

Modification du suffix
 suffix "dc=nodomain" 
 suffix "dc=mon_domaine,dc=fr" 

dans notre cas:

 suffix "dc=mdl29,dc=net" 
Activation de l'admin
 # rootdn "cn=admin,dc=nodomain" 
 rootdn "cn=admin,dc=mon_domaine,dc=fr" 

dans notre cas:

 rootdn "cn=admin,dc=mdl29,dc=net" 
 slappasswd -h {sha} 
 rootpw  ce_qui_a_ete_copier 
 rootpw {SHA}W/B9dibk7p2rUuWBfR9tsmb3vgs= 
Configuration des autorisations de lecture et d'écriture
 by dn="cn=admin,dc=nodomain" write 
 by dn="cn=admin,dc=mon_domaine,dc=fr" 

dans notre cas:

 by dn="cn=admin,dc=mdl29,dc=net" 
 by dn="cn=admin,dc=nodomain" write 
 by dn="cn=admin,dc=mon_domaine,dc=fr" 

dans notre cas:

 by dn="cn=admin,dc=mdl29,dc=net" 

La configuration est terminée, redémmarage du serveur, puis teste

 /etc/init.d/slapd restart 
 ldapsearch -D "cn=admin,dc=mdl29,dc=net" -x -W 
# extended LDIF
#
# LDAPv3
# base <> (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 32 No such object

# numResponses: 1

Ajout du schéma "qmail"

 wget http://cvs.mandriva.com/cgi-bin/viewvc.cgi/SPECS/openldap/qmail.schema?revision=1.3.6.1 
 mv qmail.schema\?revision\=1.3.6.1 /etc/ldap/schema/qmail.schema 
 include /etc/ldap/schema/inetorgperson.schema 
 include /etc/ldap/schema/qmail.schema 
 /etc/init.d/slapd restart 

Voila, la configuration du serveur LDAP est terminée