源码安装openldap2.3以前版本

来源:互联网 发布:猴王水果在线竞猜源码 编辑:程序博客网 时间:2024/05/16 10:30

http://icephoenix.us/linuxunix/build-openldap-2-3-x-from-sources-on-ubuntu/

It happened so that I needed to build a particular version of OpenLDAP on Ubuntu and use that instead of the one in Ubuntu’s repository. Here is a quick guide as to how it worked for me:

1. Get BDB 4.3 sources from Oracle’s site(link)

2. Compile BDB and install it:

tar –xvzf db-4.3.29.tar.gzcd db-4.3.29/build_unix./configure--prefix=/usr/local/bdb43makesudo make install


3. Get OpenLDAP source(ftp link)
4. Compile and install it:

tar xzvf openldap-2.3.35.tgzcd openldapexport CPPFLAGS="-I/usr/local/bdb43/include -D_GNU_SOURCE"export LDFLAGS="-L/usr/local/lib -L/usr/local/bdb43/lib -R/usr/local/bdb43lib"export LD_LIBRARY_PATH="/usr/local/bdb43/lib"./configure--prefix=/usr/local/openldap


If you’re installing version 2.3.x or anything before 2.4.15 you will need to manually patch OpenLDAP otherwise you’ll get this error:
../../include/ldap_pvt_thread.h:64: error: missing binary operator before token “(“
Patch file is available in this bug report
Or already patched file for OpenLDAP version 2.3.35 you can download here

If you’re installing anything >= 2.4.15, you can skip the patch.

Once patch is applied just run:

make dependmakemake test  #this will take a while to runmake install


Common Errors:
configure: error: Berkeley DB version mismatch
Solution:
Most likely you didn’t LDFLAGS and LD_LIBRARY_PATH as noted above

getpeereid.c:52: error: storage size of ‘peercred’ isn’t known
You need to include -D_GNU_SOURCE flag, to avoid incompatibility with glibc

../../include/ldap_pvt_thread.h:64: error: missing binary operator before token “(“
Solution:
Apply patch as noted above

error while loading shared libraries: libdb-4.3.so: cannot open shared object file: No such file or directory
Solution:
Add libdb-4.3 to shared libs cache:

sudo echo "/usr/local/bdb43/lib" > /etc/ld.so.conf.d/slapd.conflddconfig -v


This entry was posted in Linux/UNIX, Notes For Myself, System Administration and tagged bdb, ldap,openldap,slapd,ubuntu by admin. Bookmark thepermalink.

0 0
原创粉丝点击