Chinaunix

标题: 新手问个老问题!关于openldap的编译问题 [打印本页]

作者: hxnet88    时间: 2004-08-17 14:17
标题: 新手问个老问题!关于openldap的编译问题
小弟刚接触linux和openldap没多久,问了一个别人问过的问题,俺看了很久没看懂!
系统如下:
redhat 9.0
cyrus-sasl-2.1.19
db-4.2.52
openldap-2.2.15
首先安装的是db-4.2.52
# cd build_unix &&
../dist/configure --prefix=/usr \
    --enable-compat185 \
    --enable-cxx &&
make &&
make docdir=/usr/share/doc/db-4.2.52 install
正常

接着安装cyrus-sasl-2.1.19
#./configure && make && make install
#ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
#echo /usr/local/lib >;>; /etc/ld.so.conf
#echo /usr/local/lib/sasl2 >;>; /etc/ld.so.conf
#ldconfig
正常

接下来安装openldap
#./configure --prefix=/usr --sysconfdir=/etc --disable-debug \
   --libexecdir=/usr/sbin --enable-ldbm
(在这里由于我不知道我上面装的是db属于ldbm还是bdb的,我还把--enable-ldbm改成--enable-bdb,一样会产生下面的问题)
#make depend
#make
#make test
此时就出错了

cd tests; make test
make[1]: Entering directory `/data/zhanghb/openldap-2.2.15/tests'
make[2]: Entering directory `/data/zhanghb/openldap-2.2.15/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 48: kill: (23015) - No such process
ldap_bind: Can't contact LDAP server (-1)
>;>;>;>;>; Test failed
>;>;>;>;>; ./scripts/test000-rootdse failed (exit 1)
make[2]: *** [bdb-yes] Error 1
make[2]: Leaving directory `/data/zhanghb/openldap-2.2.15/tests'
make[1]: *** [test] Error 2
make[1]: Leaving directory `/data/zhanghb/openldap-2.2.15/tests'
make: *** [test] Error 2

谢谢各位大虾帮帮忙!
作者: noway01    时间: 2004-08-17 17:14
标题: 新手问个老问题!关于openldap的编译问题
我也是一样的问题啊,请各位多多指教,急着用,谢谢!
作者: py    时间: 2004-08-17 23:36
标题: 新手问个老问题!关于openldap的编译问题
建议你默认安装bdb
cd build_unix
../dist/configure
make
make install
在安装openldap的时候指出bdb的路径就可以了
作者: hxnet88    时间: 2004-08-18 10:38
标题: 新手问个老问题!关于openldap的编译问题
原帖由 "py" 发表:
建议你默认安装bdb
cd build_unix
../dist/configure
make
make install
在安装openldap的时候指出bdb的路径就可以了


您好,按照您的方式我重新编译安装,还是会出现类似的问题,现在系统环境及安装过程如下:
系统环境:
redhat 9.0
cyrus-sasl-2.1.19
db-4.2.52
openldap-2.2.15

首先安装的是db-4.2.52
# cd build_unix &&
#../dist/configure
#make
#make install
#echo /usr/local/BerkeleyDB.4.2/lib >;>; /etc/ld.so.conf
#ldconfig
正常

接着安装cyrus-sasl-2.1.19
#./configure && make && make install
#ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
#echo /usr/local/lib >;>; /etc/ld.so.conf
#echo /usr/local/lib/sasl2 >;>; /etc/ld.so.conf
#ldconfig
正常

接下来安装openldap
#env CPPFLAGS="-I/usr/local/BerkeleyDB.4.2/include \
-I/usr/local/include/sasl" LDFLAGS="-L/usr/local/BerkeleyDB.4.2/lib \
-L/usr/local/lib/sasl2" ./configure --prefix=/usr --sysconfdir=/etc \
--disable-debug \
--libexecdir=/usr/sbin
#make depend
#make
#make test
此时就出错了

cd tests; make test
make[1]: Entering directory `/data/openldap-2.2.15/tests'
make[2]: Entering directory `/data/openldap-2.2.15/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 48: kill: (28483) - No such process
ldap_bind: Can't contact LDAP server (-1)
>;>;>;>;>; Test failed
>;>;>;>;>; ./scripts/test000-rootdse failed (exit 1)
make[2]: *** [bdb-yes] Error 1
make[2]: Leaving directory `/data/openldap-2.2.15/tests'
make[1]: *** [test] Error 2
make[1]: Leaving directory `/data/openldap-2.2.15/tests'
make: *** [test] Error 2

问题依旧,同时还有一个问题,我通过ldd来看openldap编译出来的文件,发现它连接的sasl的库文件是/usr/lib/下的sasl库文件,我在编译的时候不是指定了-I了吗?/usr/lib下的sasl库文件是RedHat系统默认安装的时候自带的,有样会有什么问题吗?
作者: noway01    时间: 2004-08-18 14:11
标题: 新手问个老问题!关于openldap的编译问题
用了楼上的第一种方法,还是一样的问题,第二种方法不知道应该如何做,请问能不能清楚地说一下如何“把这些库做一个连接,都指向/usr/local/lib/sasl,我是这么做的并且成功了”,把步骤列一下,谢谢了
作者: py    时间: 2004-08-18 14:58
标题: 新手问个老问题!关于openldap的编译问题
[quote]原帖由 "noway01"]用了楼上的第一种方法,还是一样的问题,第二种方法不知道应该如何做,请问能不能清楚地说一下如何“把这些库做一个连接,都指向/usr/local/lib/sasl,我是这么做的并且成功了”,把步骤列一下,谢谢了[/quote 发表:

如果你做了--without-cyrus-sasl,make test还有问题,那就和sasl没关系了,检查bdb的库是不是加入了LD_LIBRARY_PATH
作者: noway01    时间: 2004-08-18 15:18
标题: 新手问个老问题!关于openldap的编译问题
不好意思,我比较菜,请问如何将bdb的库加入到LD_LIBRARY_PATH中?
作者: py    时间: 2004-08-18 15:59
标题: 新手问个老问题!关于openldap的编译问题
在你的profile文件中加入
LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.2/lib
export LD_LIBRARY_PATH
作者: noway01    时间: 2004-08-18 16:58
标题: 新手问个老问题!关于openldap的编译问题
对不起PY同志,请问是/etc下面的profile文件吗?里面好像是程序一样的,我完全外行,不知道该如何把你写的两句加进去,请手把手教一下好吗?或者你贴一个标准的文件上来我对着改可以吗?
作者: py    时间: 2004-08-18 19:50
标题: 新手问个老问题!关于openldap的编译问题
My God!
作者: hxnet88    时间: 2004-08-20 14:58
标题: 新手问个老问题!关于openldap的编译问题
非常感谢 py !经过多次尝试后!make test终于成功了,首先尝试了设置
LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.2/lib
export LD_LIBRARY_PATH
后,问题依旧!
然后在编译openldap的时候加上--without-cyrus-sasl参数,make test没有问题,可以确定无法make test是由于sasl的缘故,确认这个问题后,经过多次尝试,最后我的方法是先把RedHat9.0中所有关于sasl的库和头文件删除(就是系统默认安装的东东),然后把自己安装的sasl库文件及头文件覆盖过去,就是把/usr/local/lib下的sasl库拷贝一份到/usr/lib中,就ok了!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2