I need to restart my ldap setup and check that ldap itself is working. So, basically, I’m starting over. The directory with my ldap database is /var/lib/ldap. I’m going to delete everything there.

1. In /etc/openldap, there is a file called DB_CONFIG.example. Copy this file to /var/lib/ldap/DB_CONFIG.

2. Edit the file /etc/openldap/slapd.conf

include /etc/openldap/schema/core.schema

database bdb
suffix “dc=ibmprint,dc=uchicago,dc=edu”
rootdn “cn=Manager,dc=ibmprint,dc=uchicago,dc=edu”
rootpw password
directory /var/lib/ldap

3. Start ldap /etc/rc.d/init.d/ldap

4. Create a file (/tmp/entry0) with the following:

dn: dc=ibmprint,dc=uchicago,dc=edu
objectclass: dcObject
objectclass: organization
o: eshop
dc: ibmprint.uchicago.edu

dn: cn=Manager,dc=ibmprint,dc=uchicago,dc=edu
objectclass: organizationalRole
cn: Manager

5. Add these entries:

ldapadd -x -D “cn=Manager,dc=ibmprint,dc=uchicago,dc=edu” -W -f /tmp/entry0

Here, I got an error:

adding new entry “dc=ibmprint,dc=uchicago,dc=edu”
ldap_add: Naming violation (64)
additional info: naming attribute ‘dc’ is not present in entry

SOLUTION: It didn’t like the dc: ibmprint.uchicago.edu line. If I changed it to ibmprint, it worked fine.

6. Now search and see if the entries I just made are really there.

ldapsearch -x -b ‘dc=ibmprint,dc=uchicago,dc=edu’ ‘(objectclass=*)’

In my result, I see both the ibmprint entry and the Manager entry. So, basic ldap is working. Now, let’s see if I can add another user, while ldap is running.

7. Use ldapmodify to add another file (/tmp/entry1) of user data to the database.

ldapmodify -D “cn=Manager,dc=ibmprint,dc=uchicago,dc=edu” -W -x -a -f /tmp/entry1

Returned that it added new entry test1 and test2. If I do the ldapsearch command again, I do get the new users. So, it all appears to be working.