Vmware虚拟机上安装RedHat Linux 9选Workstation默认安装相关软件内核2.4.20-8
首先到www.openldap.org下载最新的版本,我下载的版本是2.3.4。解压缩该文件,
tar –zxvpf openldap-release.tgz
cd openldap-2.3.4
./configure
配置到一半时提示checking Berkeley DB version for BDB backend… no
configure: error: BDB/HDB: BerkeleyDB version imcompatible
原来没有安装Berkeley DB数据库,到www.sleepycat.com下载最新的版本,我下载的版本是4.3.28。解压缩该文件,
tar –zxvf db-4.3.28.tar.gz
cd db-4.3.28
cd build_unix
../dist/configure
make
make install
经过几分钟的等待,编译完成。在/usr/local/目录下会新建一个目录BerkeleyDB.4.3,Berkeley DB就安装在这个目录里。
再到Openldap目录再次执行./configure提示
checking Berkeley DB version for BDB backend… no
configure: error: BDB/HDB: BerkeleyDB version imcompatible
难道我数据库没有安装好??在网上找资料终于找到了。输入如下命令
env CPPFLAGS="-I /usr/local/BerkeleyDB.4.3/include"
LDFLAGS="-L /usr/local/BerkeleyDB.4.3/lib" ./configure
试了一下还是不行。会不会是库文件没有找到!
于是把/usr/local/BerkeleyDB.4.3/include中的所有文件拷贝到/usr/include
/usr/local/BerkeleyDB.4.3/lib中的所有文件拷贝到/usr/lib
运行./configure通过
再次出现错误提示没有Cyrus SASL library
在asg.web.cmu.edu下载最新的版本,我下载的版本是2.1.20
tar –zxvf cyrus-sasl-2.1.20.tar.gz
cd cyrus-sasl-2.1.20
./configure
make
make install
第三次执行./configure成功提示make depend
make
make test
cd tests; make test
make[1]: Entering directory `/home/liudan/openldap-2.3.4/tests'
make[2]: Entering directory `/home/liudan/openldap-2.3.4/tests'
Initiating LDAP tests for BDB...
Running ./scripts/all...
>>>>> Executing all LDAP tests for bdb
>>>>> Starting test000-rootdse ...
running defines.sh
Starting slapd on TCP/IP port 9011...
Using ldapsearch to retrieve the root DSE…
Waiting 5 seconds for slapd to start …
Waiting 5 seconds for slapd to start …
Waiting 5 seconds for slapd to start …
Waiting 5 seconds for slapd to start …
Waiting 5 seconds for slapd to start …
Waiting 5 seconds for slapd to start …
./scripts/test000-rootdse: line 61: kill: (3538) – No such process
ldap_bind: Can’t contact LDAP server (-1)
…
通过查看slapd.1.log
root@gregorian:/tmp/openldap-2.3.4/servers/slapd
daemon_init: ldap://localhost:9011/
daemon_init: listen on ldap://localhost:9011/
daemon_init: 1 listeners to open...
ldap_url_parse_ext(ldap://localhost:9011/)
daemon: initialized ldap://localhost:9011/
daemon_init: 1 listeners opened
slapd init: initiated server.
slap_sasl_init: SASL library version mismatch: expected 2.1.20, got 2.1.10
slapd destroy: freeing system resources.
slapd stopped.
connections_destroy: nothing to destroy.
RedHat 9默认安装的是2.1.10,删除/usr/lib下所有的lib*sasl*so的文件,
再从新安装Cyrus SASL library,再次安装Openldap
./configure && make depend && make && make test && make install
安装完成。
快速安装的步骤
tar –zxvf db-4.3.28.tar.gz
cd db-4.3.28
cd build_unix
../dist/configure && make && make install
cp /usr/local/BerkeleyDB.4.3/include/* /usr/include
cp /usr/local/BerkeleyDB.4.3/lib/* /usr/lib
ar –zxvf cyrus-sasl-2.1.20.tar.gz
cd cyrus-sasl-2.1.20
./configure && make && make install
rm –f /usr/lib/lib*sasl*so*
tar –zxvpf openldap-release.tgz
cd openldap-2.3.4
./configure && make depend && make && make test && make install
本次安装历经几天,(水平较低)终于成功,总结出一些体会。
1在安装软件前,一定要仔细看README。
2在遇到问题要多用网络资源,尤其是英文的。