debian上安装和配置ldap及phpldapadmin

WBOY
Release: 2016-06-13 10:31:35
Original
1748 people have browsed it

debian下安装和配置ldap及phpldapadmin

1.安装ldap
安装slapd 以及相关ldap工具
#apt-get install slapd ldap-utils

2.编辑配置文件
vim /etc/ldap/slapd.conf?? (个人比较喜欢vim,vi用着总不习惯)
########################################################
include???????? /etc/ldap/schema/core.schema
include???????? /etc/ldap/schema/cosine.schema
include???????? /etc/ldap/schema/nis.schema
include???????? /etc/ldap/schema/inetorgperson.schema

pidfile???????? /var/run/slapd/slapd.pid

argsfile??????? /var/run/slapd/slapd.args

loglevel??????? 256

modulepath??? /usr/lib/ldap
moduleload??? back_bdb

sizelimit 500

tool-threads 1

backend??? ??? bdb
checkpoint 512 30


database??????? bdb

suffix????????? "dc=test,dc=net"

rootdn??? ??? "cn=admin,dc=test,dc=net"
rootpw??? ??? {MD5}G0Z6gesdfW+JgkbwKcllGg==


directory?????? "/var/lib/ldap"

dbconfig set_cachesize 0 2097152 0


dbconfig set_lk_max_objects 1500
dbconfig set_lk_max_locks 1500
dbconfig set_lk_max_lockers 1500

index?????????? objectClass eq

lastmod???????? on


access to attrs=userPassword,shadowLastChange
???????by dn="cn=admin,dc=test,dc=net" write
??????? by anonymous auth
??????? by self write
??????? by * none

access to dn.base="" by * read

access to *
???????by dn="cn=admin,dc=test,dc=net" write
??????? by * read
########################################################

以上红色为要修改的,其中需要添加rootdn和rootpw两行,其中rootpw由
#slappasswd -h {md5}
得到。
修改loglevel为256产生日志文件。
#echo "local4.debug??? /var/log/ldap.log" >> /etc/syslog.conf
将ldap功能打开。
?

3.重启日志和目录服务。

#/etc/init.d/rsyslog restart?? //我的是这样的,有可能每个人的不一样

#/etc/init.d/slapd restart

4.测试是否已经正常运行
#ldapsearch -x -b '' -s? base '(objectclass=*)'
如果看到有相关信息输出就说明openldap已经正常运行了。

5.建立根
touch base.ldif
########################################################
dn: dc=test,dc=net
objectClass: dcobject
objectClass: organization
dc: test
o: test.net
description: My Test Openldap
########################################################
#ldapadd? -x -D "cn=admin,dc=test,dc=net" -W -f base.ldif
至此openladp搭建成功。

6.安装IDE,phpldapadmin
如果已配置好lamp环境,推荐使用phpldapadmin对ldap进行管理
#apt-get install phpldapadmin


作个软链接到www目录下
ln -s /usr/share/phpldapadmin /var/www

注意要使用admin登录时,Login DN填入:cn=admin,dc=test,dc=net

?

在地址栏里直接输入:

http://192.168.89.130/phpldapadmin这样就可以直接访问了。

?

LDAP目录结构示意图



?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!