ServeurLDAP
1. Installation
su - yum -y install openldap openldap-clients openldap-servers nss_ldap
Adapter le fichier de configuration :
(exemple : slapd.conf Δ)
cp /etc/openldap/slapd.conf /etc/openldap/slapd.conf.dist vi /etc/openldap/slapd.conf
Ajouter le fichier websphere.schema Δ dans le répertoire /etc/openldap/schema/.
Récupérer le fichier .ldif de la sauvegarde de la base LDAP a restaurer, par exemple :
mkdir /usr2/ldap rsync -avz knl001:/etc/ldap/ldif/<hostname>.ldif /tmp/
Restaurer la base LDAP :
slapadd -v -c -l /tmp/<hostname>.ldif -f /etc/openldap/slapd.conf slapindex -v -f /etc/openldap/slapd.conf chown ldap:ldap /var/lib/ldap/*
Activer le lancement au boot :
chkconfig ldap on
2. Installation phpLDAPadmin
yum -y install phpldapadmin
Ouvrir les ports http, https, ldap:tcp, ldap:udp et atmtcp:tcp du firewall :
export DISPLAY=<hostname>:0.0 system-config-securitylevel
Autoriser l'accessibilité au domaine <domain> :
sed -i 's/Allow from 127.0.0.1/Allow from <domaine>/' /etc/httpd/conf.d/phpldapadmin.conf
Configurer phpldapadmin :
[[ ! -f /etc/phpldapadmin/config.php.dist ]] && rsync -a /etc/phpldapadmin/config.php /etc/phpldapadmin/config.php.dist sed -i "s/Local LDAP Server/`hostname -s`/" /etc/phpldapadmin/config.php sed -i "s/^\$ldapservers->SetValue(\$i,'login','attr','uid');/#\$ldapservers->SetValue(\$i,'login','attr','uid');/" /etc/phpldapadmin/config.php
Activer le lancement au boot :
chkconfig httpd on
3. Démarrage
Pour démarrer le serveur LDAP :
service ldap stop service ldap start
Pour relancer le serveur HTTP pour phpLDAPadmin :
service httpd graceful