OPENLDAP安装配置方法
1. 平台及相关软件
OS:CentOS5.3
gcc:4.1.2
BerkeleyDB:4.8.24
openldap:2.4.19
2. 安装步骤
1) 安装BerkeleyDB数据库
[root@localhost BerkeleyDB]# tar -zxvf db-4.8.26.gz [root@localhost BerkeleyDB]# cd db-4.8.26 [root@localhost db-4.8.24]# cd build_unix/ [root@localhost db-4.8.24]# ../dist/configure [root@localhost db-4.8.24]# make [root@localhost db-4.8.24]# make install
2) 安装OpenLdap
(1) 增加库路径
# vi /etc/ld.so.conf /usr/local/BerkeleyDB.4.8/lib # /sbin/ldconfig
(2) 设置环境变量
env CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include"LDFLAGS="-L/usr/local/BerkeleyDB.4.5/lib" ./configure \\
(3) 编译
#./configure--prefix=/usr/local/openldap --enable-bdb #make depend #make #make test #make install
3.FAQ
(1) 不装GCC,执行./configure时,
出现错误:
configure: error: Unable to locate
cc(1) or suitable replacement. Check PATH or set CC.
解决方 法:
install gcc [root@localhost openldap-2.4.19]#yum -y install gcc
(2) 不装BerkeleyDB,执行./configure时,
出现错误:
configure: error: BDB/HDB:
BerkeleyDB not available
解决方法:
[root@localhost BerkeleyDB]# tar –zxvf bdb-4.8.24.tar.gz [root@localhost BerkeleyDB]# cd db-4.8.24 [root@localhost db-4.8.24]# cd build_unix/ [root@localhost db-4.8.24]# ../dist/configure [root@localhost db-4.8.24]# make [root@localhost db-4.8.24]# make install [root@localhost openldap-2.4.19]#export CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include" [root@localhost openldap-2.4.19]#export LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.4.8/lib -R/usr/local/BerkeleyDB.4.8/lib" [root@localhost openldap-2.4.19]#export LD_LIBRARY_PATH="/usr/local/BerkeleyDB.4.8/lib"
(3) 出问题: configure: error: BDB/HDB: BerkeleyDB version incompatible
环境变量问题:
env CPPFLAGS=”-I/Berkeley/include” LDFLAGS=”-L/Berkeley/lib”
./configure –prefix=/ldap –with-wrappers –enable-ldbm
openldap 安装告于段落 ,不足之处,请大家多多指正,谢谢。