82487106 2014-03-05
1、安装OpenLDAP
yum install openldap openldap-*
service slapd start
2、下载
wget http://nchc.dl.sourceforge.net/project/phpldapadmin/phpldapadmin-php5/1.2.3/phpldapadmin-1.2.3.tgz
tar -zxvf phpldapadmin-1.2.3.tgz
mv phpldapadmin /var/www/html/
3、配置服务
vi /etc/sysconfig/ldap,确保SLAPD_LDAPI=yes
cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.conf
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIGmv /etc/openldap/slapd.d{,.bak}
生成密码:
slappasswd
[root@LAMP ~]# slappasswd
New password:
Re-enter new password:
vi slapd.conf
找到语句:
suffix“dc=my-domain,dc=com”
将其改为:
suffix“dc=example,dc=com”
__
找到语句:
rootdn“cn=Manager,dc=my-domain,dc=com”
将其改为:
rootdn“cn=Manager,dc=example,dc=com”
__
找到语句:
rootpw secret
将其改为:
rootpw {SSHA}NddfeSDFESFrr#r
如下效果:
+++++++++++++++++++++++
database bdb
suffix "dc=example,dc=com"
checkpoint 1024 15
rootdn "cn=Manager,dc=example,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# rootpw {crypt}ijFYNcSNctBYg
_____________________
cd /var/www/html/phpldapadmin/config
cp config.php.example config.php
vim config.php
530 $servers->newServer('ldap_pla');
531 $servers->setValue('server','name','LDAP Server');
532 $servers->setValue('server','host','127.0.0.1');
533 $servers->setValue('server','port',389);
534 $servers->setValue('server','base',array('dc=example,dc=com'));
535 $servers->setValue('login','auth_type','session');
536 $servers->setValue('login','bind_id','cn=root,dc=example,dc=com');
537 $servers->setValue('login','bind_pass','example.com');
538 $servers->setValue('server','tls',false);
OpenLDAP 的详细介绍:请点这里
OpenLDAP 的下载地址:请点这里
相关阅读: