这两天安装LDAP服务器,烦到死啊!开始是BerkeleyDB下载不了,下好了吧,又出现“configure: error: BDB/HDB: BerkeleyDB not available”问题,网上查了半天没有解决掉!今天看到一篇帖子,然后换了一个BerkeleyDB,开始是用的5.1版本,换成4.8.30!
好吧,上面那个痛经班的问题算是没了,但是,又出现了版本号不兼容!header和library的版本不一致,我勒个去啊!没办法,只能把header中的宏改成4.8.24了,悲催!
现在,算是弄了,烦啊!
(下面是那篇神帖,拜啊!)
背景:
配置WAS的standalone LDAP加密时,选择安装了openldap。
下载的openldap版本:openldap-2.4.23
问题:
在./configure时,报checking if Berkeley DB version supported by BDB/HDB backends… no@H_301_22@ configure: error: BerkeleyDB version incompatible with BDB/HDB backends
需要先安装BerkeleyDB,下载地址:
http://www.oracle.com/technetwork/database/berkeleydb/downloads/index-082944.html
我最先下载的是提供的最新的版本:db-5.1.25.NC.zip
安装步骤:
unzip db-5.1.25.NC.zip 解压,然后cd build_unix/ ,再运行../dist/configure , 最后,运行make,make install安装。默认的安装在/usr/local, 可以通过 ../dist/configure –prefix=你的路径,来改变安装路径。
安装好db-5.1.25.NC.zip后,发现对openldap进行configure时,还是报错:
configure: error: BDB/HDB: BerkeleyDB not available
解决办法:
尝试了网上很多办法,还是不行。决定换一个BerkeleyDB的版本试试。
于是重新下载了:db-4.8.30.NC.zip
重新安装好BerkeleyDB后,需要添加一些环境变量,见以下粗体部分:@H_301_22@ [root@mylinux openldap-2.4.23]# export CPPFLAGS=”-I/usr/local/BerkeleyDB.4.8/include”@H_301_22@ [root@mylinux openldap-2.4.23]#export LDFLAGS=”-L/usr/local/lib -L/usr/local/BerkeleyDB.4.8/lib -R/usr/local/BerkeleyDB.4.8/lib”@H_301_22@ [root@mylinux openldap-2.4.23]# export LD_LIBRARY_PATH=”/usr/local/BerkeleyDB.4.8/lib”@H_301_22@ [root@mylinux openldap-2.4.23]# env@H_301_22@ LDFLAGS=-L/usr/local/lib -L/usr/local/BerkeleyDB.4.8/lib -R/usr/local/BerkeleyDB.4.8/lib@H_301_22@ HOSTNAME=mylinux@H_301_22@ TERM=vt100@H_301_22@ SHELL=/bin/bash@H_301_22@ HISTSIZE=1000@H_301_22@ CPPFLAGS=-I/usr/local/BerkeleyDB.4.8/include@H_301_22@ SSH_CLIENT=::ffff:192.168.0.10 3336 22@H_301_22@ OLDPWD=/apps/openldap@H_301_22@ SSH_TTY=/dev/pts/2@H_301_22@ USER=root@H_301_22@ LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.8/lib
======================================================
最后,进行openldap的安装
1、[root@mylinux openldap-2.4.23]# ./configure@H_301_22@ ….@H_301_22@ Making servers/slapd/overlays/statover.c@H_301_22@ Add syncprov …@H_301_22@ Please run “make depend” to build dependencies@H_301_22@ [root@mylinux openldap-2.4.23]#@H_301_22@ 看到“Please run “make depend” to build dependencies”说明configure完毕。@H_301_22@ 2、[root@mylinux openldap-2.4.23]# make depend@H_301_22@ Making depend in /apps/openldap/openldap-2.4.23@H_301_22@ Entering subdirectory include@H_301_22@ make[1]: Entering directory `/apps/openldap/openldap-2.4.23/include’@H_301_22@ Making ldap_config.h@H_301_22@ make[1]: Leaving directory `/apps/openldap/openldap-2.4.23/include’@H_301_22@ ….@H_301_22@ Entering subdirectory man5@H_301_22@ make[3]: Entering directory `/apps/openldap/openldap-2.4.23/doc/man/man5′@H_301_22@ make[3]: Nothing to be done for `depend’.@H_301_22@ make[3]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man/man5′@H_301_22@ Entering subdirectory man8@H_301_22@ make[3]: Entering directory `/apps/openldap/openldap-2.4.23/doc/man/man8′@H_301_22@ make[3]: Nothing to be done for `depend’.@H_301_22@ make[3]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man/man8′@H_301_22@ make[2]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man’@H_301_22@ make[1]: Leaving directory `/apps/openldap/openldap-2.4.23/doc’
3、[root@mylinux openldap-2.4.23]# make@H_301_22@ ……………………….@H_301_22@ done@H_301_22@ make[3]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man/man8′@H_301_22@ make[2]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man’@H_301_22@ make[1]: Leaving directory `/apps/openldap/openldap-2.4.23/doc’@H_301_22@ 4、[root@mylinux openldap-2.4.23]# make test@H_301_22@ 5、[root@mylinux openldap-2.4.23]# make install@H_301_22@ 安装完成。配置文件的路径在:/usr/local/etc/openldap@H_301_22@ 最后启动服务:
到路径/usr/local/libexec下
[root@mylinux libexec]# ./slapd
[root@mylinux libexec]# ps -ef|grep slapd |grep -v grep
root 5771 1 0 18:41 ? 00:00:00 ./slapd
原文链接:https://www.f2er.com/bash/391089.html