Setting up example directories in "LDAP Programming with Java" book for OpenLDAP instead of Netscape Directory Server

Aug 12th 2001

"LDAP Programming with Java" published by Addison Wesley Longman, Inc. is one of the complete guide about LDAP. Although the Netscape Directory Server(NDS) is used in this book, most of topics are concentrated in Java programming. Because I'm using OpenLDAP instead of NDS on Linux (and Windows), I should have adjusted configurations so that I can follow sections in title. The following story starts with the assumtion that the reader has already installed OpenLDAP and GUI tools successfully. Have fun! [Refer Here]

Stop the LDAP server running and remove current confs and data.

kill -INT <process id of ./slapd>

cd /usr/local/var/
tar cvfz openldap-ldbm-teddy.tar.gz openldap-ldbm
rm openldap-ldbm/*

cd /usr/local/etc/openldap/
cp slapd.conf teddy-slapd.conf

Edit slapd.conf

include         /usr/local/etc/openldap/schema/core.schema
include         /usr/local/etc/openldap/schema/cosine.schema
include         /usr/local/etc/openldap/schema/inetorgperson.schema
database ldbm
suffix  "o=airius.com"
rootdn  "cn=Directory Manager,o=airius.com"
rootpw  secret
directory /usr/local/var/openldap-ldbm
index objectClass eq

Start server.

setup gq
cd /usr/local/libexec/
./slapd

gq

Base DN should be changed to o=airius.com.

Bind DN and Bind Password are set consistently with slapd.conf.

Now we can see empty tree of o=airius.com by gq. Also it possible to check it by command line.

# ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts
version: 2

#
# filter: (objectclass=*)
# requesting: namingContexts
#

#
dn:
namingContexts: o=airius.com

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

Adjusting airiusplus.ldif to fit to OpenLDAP

Remove all lines written as "objectclass: top". OpenLDAP doesn't require explicit statement of 'top'.

Replace "aci" with "OpenLDAPaci".

Though I tried the ldapadd command first,
ldapadd -x -D "cn=Directory Manager,o=airius.com" -W -f airiusplus.ldif
couldn't load entries.

Launch LDAP Browser/Editor

cd ldapbrowser/
./lbe.sh
Change the Base DN, Bind DN, and Bind Password correctly similar to gq.
After connect to the LDAP server (localhost), use LDIF/Import command in the menu.
All the entries are loaded simply by selecting our editted airiusplus.ldif file. *great :-)*

Clicking each entries, we can easilly have attributes.

Congrats:-) Now we can start reading the book.

I thank Rob Weltman, who is one of authors of the book, for informative support.