Thursday, August 23, 2007

installing ldap server

Easy steps to install LDAP Server:

% apt-get install slapd ldap-utils

Towards the end of the installation process you are asked to answer some configurations questions, if you get errors, just skipped the configuration process then use below command to configure it:

% dpkg-reconfigure slapd

Omit OpenLDAP server configuration? ... No
DNS domain name: ... [enter your domain name here, say example.com]
Name of your organization: ... [enter your organization name here]
Admin Password: XXXXX
Confirm Password: XXXXX
OK
choose Berkeley DB --> BDB
Do you want your database to be removed when slapd is purged? ... No
Move old database? ... Yes
Allow LDAPv2 Protocol? ... Yes/No [Depends on your situation]

To test it use:
% ldapsearch -x -b dc=example,dc=com

If you encountered this error message: ldap_bind: Can't contact LDAP server (-1)
it may caused by the ldap server not started yet, so try to start it using:
% /etc/init.d/slapd start

No comments: