Scripts and Configuration Files

You are now ready to start the server.

slapd -f /your/directory/slapd.conf -d 1

You may recall that the configuration file was in a user's directory. It should be in /etc/slapd.conf for a running, real configuration, or else in some other standard (for you) place, but ours is just a demonstration.

You've built the software, you're feeling comfortable about slapd.conf and about slapd.oc.conf (remember that our file for attributes, slpad.at.conf, is empty for now). Let's go look at those scripts you saw in the presentation.

We have three files so that we don't have to remember commands: one to create, one to add information, and one to modify it.

Create a database for ldap
ldapadd -D"cn=root,o=ATL" -w foo -cf top

Add an item or definitions of items to the database
ldapadd -D"cn=root,o=ATL" -w foo -cf $1

Modify an item or definitions of items in the database
ldapmodify -D"cn=root,o=ATL" -w foo -cf $1

You will note that we use the file top to define what our database looks like. Once the database has been created, with nice, loose definitions, we can go back in and create slots that are closer to our liking. First we define the top level of items, and then add to the definitions with further layers. These levels have been renamed in an effort to make it easy to understand what is going on. The add script comes in handy.

./add Level1
./add Level2

We are ready to data to the definitions. We have lots of different types: nodes, branches, some people, a few leaves, and spokes. We can add them in any order, since they are all levels that are end nodes (or leaves, or...).

./add us
./add branches
./add leaves
./add nodes
./add spokes

Congratulations! It's a database, with stuff in it. You can now start the slapd daemon, using debug (so that you are able to watch your database react as you make queries).

slapd -f /your/directory/etc/slapd.conf

You may connect to the database using ud.

ud -s your_server_machine

This gives you access to the commands to look at your data, and examine the database.

predator{shrdlu}261% ud -s predator
LDAP UserDirectory 1.2.11-Release (Sun Dec 10 08:27:36 PST 2000)

  Enter a command.  If you need help, type 'h' or '?' and hit RETURN.

* cd o=atl
  Search base is now atl
* find rabbs
  Found one exact match for "rabbs"
 "Roger Pollack"
  Aliases:             Mr. Slippery
                       warlock
* find branch1
  2 names matched "branch1".
  Do you wish to see a list of names? y
   1. branch1
   2. branch1
  Enter the number of the name you want or Q to quit:  2
 "branch1"
  Aliases:             Branch One
  More Info (URL):     main site for  UUASC can be found at
   http://www.uuasc.org/
                         The
* find spoke
  8 names matched "spoke".
  Do you wish to see a list of names? y
   1. spoke1
   2. spoke3
   3. spoke5
   4. spoke4
   5. spoke2
   6. spoke6
   7. spoke7
   8. spoke8
  Enter the number of the name you want or Q to quit: 8
 "spoke8"
  Aliases:             The Hub
  More Info (URL):     not, start here
   http://www.openldap.org/software/man.cgi?query=ldap
                         If
* quit
 Thank you!

There are many things you can support with the ldap structure, including pgp databases, employee databases, address books. I am currently investigating the replacement of NIS with ldap, since I prefer the greater control I will have over the user base and host accumulation.


Etaoin Shrdlu
Last modified: Sun Oct 31 08:44:07 PST 2004