Chinaunix首页 | 论坛 | 博客
  • 博客访问: 615162
  • 博文数量: 16
  • 博客积分: 10150
  • 博客等级: 上将
  • 技术积分: 209
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-11 14:59
文章分类

全部博文(16)

文章存档

2015年(2)

2014年(2)

2013年(1)

2010年(7)

2009年(3)

2008年(1)

分类: LINUX

2010-11-29 19:32:56

Detailed steps to make OpenLDAP-2.4.23 works with Berkeley DB 5.1
by Kylin Ming from YOYOSYS

1.   Install Berkeley DB 5.1

First, download Berkeley DB:

Then extract it to current folder.

cd db-5.1.19.NC/build_unix/

Execute the following commands to install BDB on the box:

../dist/configure

make

sudo make install

After that, edit /etc/ld.so.conf and add the following line to the end of the file.

/usr/local/BerkeleyDB.5.1/lib

Then

sudo ldconfig

 

2.     Install and Configure OpenLDAP 2.4.23

First, download openldap from the following link

Then extract it to current folder.

Patch it (without this step, you will encounter “configure: error: BDB/HDB: BerkeleyDB not available” error)

wget

patch –p0 < openldap-2.4.23-bdb5-1.patch

cd openldap-2.4.23

with the following commands to install openldap:

env CPPFLAGS="-I/usr/local/BerkeleyDB.5.1/include" LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.5.1/lib -R/usr/local/BerkeleyDB.5.1/lib" LD_LIBRARY_PATH="/usr/local/BerkeleyDB.5.1/lib" ./configure

make depend

make

sudo make install

After that, edit slapd.conf to make it works as expected:

sudo vi /usr/local/etc/openldap/slapd.conf

        Changed “my-domain” at the line 54 and 55 to “yoyosys”

        Back to line 6 and insert the following three lines

        include          /usr/local/etc/openldap/schema/corba.schema

        include         /usr/local/etc/openldap/schema/cosine.schema

        include         /usr/local/etc/openldap/schema/inetorgperson.schema

        Save and exit.

        Copy DB_CONFIG to appropriate folder and then start slapd.

        sudo cp /usr/local/etc/openldap/DB_CONFIG.example /usr/local/var/openldap-data/DB_CONFIG

        sudo /usr/local/libexec/slapd

        You may execute the following command to make sure slapd starts.

        sudo netstat -tnlp | grep 389

        Add users with .ldif file

        ldapadd -x -D "cn=Manager,dc=yoyosys,dc=com" -W -f testdata.ldif

        Search for specified user or group

        ldapsearch -x -b 'dc=yoyosys,dc=com'

 

 

Hope this helps.

 

 

Thanks,

Kylin


阅读(1938) | 评论(4) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-02-28 22:04:45

thanks! this document help and was useful

chinaunix网友2011-02-28 22:04:04

thanks! this was really helping me.

chinaunix网友2011-02-26 14:41:39

it helps a lot, thank you!

chinaunix网友2011-01-25 11:19:44

thx for sharing. very useful.