1:安装zlib
下载zlib-1.2.3.tar.gz(或其它版本号)
wget http://down1.chinaunix.net/distfiles/zlib-1.2.3.tar.gz
# ./configure --shared
# make
# make install
2:安装openssl
不要卸载系统自带的Openssl,否则非常多服务都起不来
wget http://101.44.1.124/files/613900000275279B/mirrors.163.com/gentoo/distfiles/openssl-1.0.1j.tar.gz
# ./config shared #注意这里是用./config 会安装到/usr/local/ssl
# make
# make install
出现报错:
“POD document had syntax errors at /usr/bin/pod2man line 71.
make: *** [install_docs] 错误 25”
编辑/usr/bin/pod2man文件,凝视掉第71行。
#配置库文件搜索路径
# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
# ldconfig -v
3:安装BerkeleyDB
下载db-5.3.28.tar.gz
解压到目录db-5.3.28
进入到目录db-5.3.28/build_unix
# ../dist/configure --sysconfdir=/etc #默认路径/usr/local/BerkeleyDB.5.3
# make
# make install
#配置库文件搜索路径
# echo "/usr/local/BerkeleyDB.5.3/lib" >> /etc/ld.so.conf
# ldconfig -v
4:安装openldap
下载openldap-2.4.30.tgz
解压到openldap-2.4.30
进入目录openldap-2.4.30
# env CPPFLAGS="-I/user/include -I/usr/local/BerkeleyDB.5.3/include -I/usr/local/ssl/include-D_GNU_SOURCE"
LDFLAGS="-L/usr/lib -L/usr/local/BerkeleyDB.5.3/lib -L/usr/local/ssl/lib" ./configure --prefix=/usr/local/openldap --with-tls=openssl -enable-dynamic (注意引入的三组暂时变量须要相应BerkeleyDB和openSSL的库文件文件夹文件夹)
# make depend
# make
# make test #这一步时间会非常长
# make install
#配置库文件搜索路径
# echo "/usr/local/openldap/lib" >> /etc/ld.so.conf
# ldconfig -v
启动LDAP:
/usr/local/openldap/libexec/slapd
写一个test.ldif数据文件
dn: dc=Tree,dc=com
objectClass: dcObject
objectClass: organization
dc: Tree
o: Tree Company
dn: cn=Manager,dc=Tree,dc=com
objectClass: organizationalRole
objectClass: top
cn: Manager
运行:
/usr/local/openldap/bin/ldapadd -x -D "cn=Manager,dc=Tree,dc=com" -w 123456 -f
test.ldif
导入成功完成部署。
版权声明:本文博客原创文章。博客,未经同意,不得转载。