ubuntu下安装OpenLdap
安装OpenLdap需要BerkeleyDB的支持,否则configure时会报如下错误:
configure: error: BDB/HDB: BerkeleyDB not available
1.安装BerkeleyDBtar xvfz db-4.6.21.tar.gzcd db-4.6.21/build_unix/../dist/configure -prefix=/usr/local/BerkeleyDBmakemake install2.配置环境变量
vi /etc/profileexport CPPFLAGS="-I/usr/local/BerkeleyDB/include"export LDFLAGS="-L/usr/local/BerkeleyDB/lib"
??wq保存后退出,使环境变量生效
source /etc/profile?3.复制文件
cp /usr/local/BerkeleyDB/lib/* /usr/libcp /usr/local/BerkeleyDB/include/* /usr/include
?注意:如不按照以上步骤可能会报如下错误:
?configure: error: Berkeley DB version mismatch
4.安装OpenLdaptar zvxf openldap2.4.29.tgzcd /openldap2.4.29./configure --prefix=/usr/local/openldapmake dependmakemake testmake install
? 注意: 在执行./configure的时候可能会报如下错误
configure: error: MozNSS not found – please specify the location to the NSPR and NSS header files in CPPFLAGS and the location to the NSPR and NSS libraries in LDFLAGS (if not in the system location)
? 原因是openldap需要依赖openssl的一些库文件,安装openldap,然后配置SSL的环境变量
export CPPFLAGS="-I/usr/local/BerkeleyDB/include -I/usr/local/ssl/include"
export LDFLAGS="-L/usr/local/BerkeleyDB/lib -L/usr/local/ssl/lib"