优化一个网站可以做多少关键词,河源和平县建设局网站,机械设备网站建设,建设企业网站需要注意的问题简介#xff1a;LDAP(轻量级目录服务访问协议#xff0c;Lightweight Directory Access Protocol)基于X.500标准#xff0c;支持TCP/IP#xff0c;使用简单方便。现在越来越多的网络应用系统都支持LDAP。 目录是一个为查询、浏览和搜索而优化的专业分布式数据库LDAP(轻量级目录服务访问协议Lightweight Directory Access Protocol)基于X.500标准支持TCP/IP使用简单方便。现在越来越多的网络应用系统都支持LDAP。 目录是一个为查询、浏览和搜索而优化的专业分布式数据库它成树状结构组织数据就好象Linux/Unix系统中的文件目录一样。目录数据库和关系数据库不同它有优异的读性能但写性能差并且没有事务处理、回滚等复杂功能不适于存储修改频繁的数据。所以目录天生是用来查询的就好象它的名字一样。目录服务是由目录数据库和一套访问协议组成的系统。类似以下的信息适合储存在目录中 企业员工和企业客户之类人员信息公用证书和安全密钥邮件地址、网址、IP等电脑信息电脑配置信息。 而且在我们的日常生活中很多的应用都是基于LDAP的比如Microsoft服务器的AD管理以及IBM的邮件Lotus都是基于LDAP的并且Linux下的Postfix也可以设计成支持LDAP的形式这篇文单权当是入门之用吧以前有试过做基于Mysql的Postfix邮件系统 [url]http://waringid.blog.51cto.com/65148/58580[/url]也打算用LDAP来实现我会把我的安装经历整理出来的支持软件安装OpenLDAP的相关支持软件是Berkeley DB有了它就可以进行了当然如果你要求Sasl的支持的话那cyrus-sasl这个支持包也是少不了的不过这个软件包一般系统中会自带而且OpenLDAP在编译时默认会加入此功能支持这些软件的下载地址可以参考我以前写过的一篇文章 [url]http://waringid.blog.51cto.com/65148/58144[/url]其中有列出下载地址而OpenLDAP的下载地址则是 [url]ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release[/url]系统相关在Linux下不同版本的系统在设置上可能会有很小的差异所以这里交待一下我的系统RedHat AS 4安装时所选的系统组件只有开发工具其它的所有软件包都没有选取如果你是Linux新手对装系统还有一些困难的话请参考这篇文章[url]http://waringid.blog.51cto.com/65148/47655[/url]下载相关软件查询并卸载系统中原有的相关软件rpm -qa |grep ldap
rpm -e --nodeps 显示的组件安装BerkeleyDBtar zxvf db-4.5.20.tar.gz
cd db-4.5.20/build_unix
../dist/configure --prefix/usr/local/BerkeleyDB
make
make install
echo /usr/local/BerkeleyDB/lib /etc/ld.so.conf
ldconfig -v安装Cyrus-Sasltar zxvf cyrus-sasl-2.1.21.tar.gz
cd cyrus-sasl-2.1.21
./configure --prefix/usr/local/sasl --enable-cram --enable-plain \
--enable-digest --disable-anon --enable-krb4 --enable-ntlm
make
make install
echo /usr/local/sasl/lib/ /etc/ld.so.conf
ldconfig -v
ln -sv /usr/local/sasl/include/sasl/* /usr/local/include/
ln -sv /usr/local/sasl/lib/* /usr/local/lib/
ln -sv /usr/local/sasl/lib/sasl2/* /usr/local/lib/安装OpenLDAPgunzip -c openldap-2.4.9.tgz | tar xvfB -
cd openldap-2.4.9
env CPPFLAGS-I/usr/local/BerkeleyDB/include LDFLAGS-L/usr/local/BerkeleyDB/lib \
./configure --prefix/usr/local/openldap --sysconfdir/etc --enable-ldbm \
--enable-lmpasswd --enable-spasswd --enable-bdb --enable-ldap
make depend
make
make install
echo /usr/local/openldap/lib /etc/ld.so.conf
ldconfig -v配置LADPLDAP的配置中我们要实现的功能如图所示需要增加一个用户Ben生成LDAP管理密码/usr/local/openldap/sbin/slappasswd -h {md5}
{MD5}X03MO1qnZdYdgyfeuILPmQ##此密码是LDAP管理密码,和系统密码无关增加相关查询记录echo 127.0.0.1 ldap.test.com /etc/hosts
echo 127.0.0.1 ldap-master.test.com /etc/hosts设置slapd.conf文件vi /etc/openldap/slapd.conf
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
database bdb
suffix dctest,dccom
rootdn cnManager,dctest,dccom
rootpw {MD5}X03MO1qnZdYdgyfeuILPmQ
directory /var/lib/ldap设置ldap.conf文件vi /etc/openldap/ldap.conf
HOST 127.0.0.1
BASE dctest,dccom
URI ldap://ldap.test.comldap://ldap-master.test.com:389
SIZELIMIT 12
TIMELIMIT 15
DEREF nerver启动LDAP/usr/local/openldap/libexec/slapd增加用户资料vi test.ldif
#root node ##建立DN
dn:dctest,dccom
dc:test
objectclass:dcObject
objectclass:organizationalUnit
ou:test Dot com
#login top ##建立RDN
dn:oulogin,dctest,dccom
ou:login
objectclass:organizationalUnit
#user,uid,password
dn:ouuser,oulogin,dctest,dccom
ou:user
objectclass:organizationalUnit
#group
dn:ougroup,oulogin,dctest,dccom
ou:group
objectclass:organizationalUnit
#company organization top
dn:oucompany,dctest,dccom
ou:company
objectclass:organizationalUnit
#for company organization(unit)
dn:ouunit,oucompany,dctest,dccom
ou:unit
objectclass:organizationalUnit
#human resource(under unit)
dn:ouhr,ouunit,oucompany,dctest,dccom
ou:hr
objectclass:organizationalUnit
#MIS(under unit)
dn:oumis,ouunit,oucompany,dctest,dccom
ou:mis
objectclass:organizationalUnit
#Editorial(under unit)
dn:oueditorial,ouunit,oucompany,dctest,dccom
ou:editorial
objectclass:organizationalUnit
vi user.ldif ##建立用户数据#User-Ben Chan
dn:cnben,oueditorial,ouunit,oucompany,dctest,dccom
cn:ben
sn:chan
objectclass:organizationalUnit
givenName:ben
mail:mingtest.com
telephoneNumber:1234678
mobile:98765432
postalAddress:dongguan
postalCode:86
ou:editorial
o:test Corp
labeledURL:[url]http://waringid.blog.51cto.com[/url]
title:Editor
postalCode: 区号
ou:部门
o机构
title:职位解决中文符号问题dos2unix user.ldif
iconv -f gb2312 -t UTF-8 -o user.ldif.utf8 user.ldif
file user.ldif.utf8
ldapmodify -D cnManager,dctest,dccom -w secret -x -a -f user.ldif.utf8测试ldapsearch -x -b ouunit,oucompany,dctest,dccom通过web方式管理LADP以命令的方式来管理LDAP是最快最直接的方法但是需要用户有一定的Linux管理能力及对LDAP结构深入的理解还有一种方式就是通过WEB的方式进行管理这种方式和phpmyadmin管理mysql差不多用它则是最方便讯速了下载地址为 [url]http://sourceforge.net/project/showfiles.php?group_id61828[/url]它的配置方法和phpmyadmin的配置方法差不多这里就不过多描述了参考以前的文件应可以自行设置 [url]http://waringid.blog.51cto.com/65148/58210[/url]需要注意的是要将配置文件从config目录中copy到它的上一级目录然后需要设置以下一些地方 $ldapservers-SetValue($i,server,auth_type,session); $ldapservers-SetValue($i,login,dn,cnManager,dctest.com); $ldapservers-SetValue($i,login,pass,);