LDAP服務器安裝

這兩天安裝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
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後,需要添加一些環境變量,見以下粗體部分:
[root@mylinux openldap-2.4.23]# export CPPFLAGS=”-I/usr/local/BerkeleyDB.4.8/include”
[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”
[root@mylinux openldap-2.4.23]# export LD_LIBRARY_PATH=”/usr/local/BerkeleyDB.4.8/lib”
[root@mylinux openldap-2.4.23]# env
LDFLAGS=-L/usr/local/lib -L/usr/local/BerkeleyDB.4.8/lib -R/usr/local/BerkeleyDB.4.8/lib
HOSTNAME=mylinux
TERM=vt100
SHELL=/bin/bash
HISTSIZE=1000
CPPFLAGS=-I/usr/local/BerkeleyDB.4.8/include
SSH_CLIENT=::ffff:192.168.0.10 3336 22
OLDPWD=/apps/openldap
SSH_TTY=/dev/pts/2
USER=root
LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.8/lib

======================================================

最後,進行openldap的安裝

1、[root@mylinux openldap-2.4.23]# ./configure
….
Making servers/slapd/overlays/statover.c
Add syncprov …
Please run “make depend” to build dependencies
[root@mylinux openldap-2.4.23]#
看到“Please run “make depend” to build dependencies”說明configure完畢。
2、[root@mylinux openldap-2.4.23]# make depend
Making depend in /apps/openldap/openldap-2.4.23
Entering subdirectory include
make[1]: Entering directory `/apps/openldap/openldap-2.4.23/include’
Making ldap_config.h
make[1]: Leaving directory `/apps/openldap/openldap-2.4.23/include’
….
Entering subdirectory man5
make[3]: Entering directory `/apps/openldap/openldap-2.4.23/doc/man/man5′
make[3]: Nothing to be done for `depend’.
make[3]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man/man5′
Entering subdirectory man8
make[3]: Entering directory `/apps/openldap/openldap-2.4.23/doc/man/man8′
make[3]: Nothing to be done for `depend’.
make[3]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man/man8′
make[2]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man’
make[1]: Leaving directory `/apps/openldap/openldap-2.4.23/doc’

3、[root@mylinux openldap-2.4.23]# make
……………………….
done
make[3]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man/man8′
make[2]: Leaving directory `/apps/openldap/openldap-2.4.23/doc/man’
make[1]: Leaving directory `/apps/openldap/openldap-2.4.23/doc’
4、[root@mylinux openldap-2.4.23]# make test
5、[root@mylinux openldap-2.4.23]# make install
安裝完成。配置文件的路徑在:/usr/local/etc/openldap
最後啓動服務:

到路徑/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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章