2. Untar the distribution. Pick a place for the LDAP source to live, cd there, and untar it. For example:
zcat ldap.tar.Z | tar xvf -
In the include/ldapconfig.h.edit file, be sure to set the DEFAULT_BASE and LDAPHOST variables to something appropriate for your site. Other than that, the defaults should work OK.
4. Make the software. From the top level LDAP source directory, type:
5. Install the software. From the top level LDAP source directory, type:
6. Make a configuration file. Create a file called myslapd.conf and enter the following lines into it. See Section 5 for more details on this file.
suffix "o=<YOUR ORGANIZATION>, c=US"
rootdn "cn=<YOUR NAME>, o=<YOUR ORGANIZATION>, c=US
7. Create a database. This is a two-step process. Step A is to create a file (we'll call it myldif) containing the entries you want your database to contain. Use the following example as a guide, or see Section 7.3 for more details.
dn: o=<YOUR ORGANIZATION>, c=US
o: <YOUR ORGANIZATION>
dn: cn=<YOUR NAME>, o=<YOUR ORGANIZATION>, c=US
cn: <YOUR NAME>
sn: <YOUR LAST NAME>
mail: <YOUR EMAIL ADDRESS>
Step B is to run this file through a tool to create the slapd database.
$(ETCDIR)/ldif2ldbm -f myslapd.conf -i myldif
8. Start slapd. Because slapd listens on a privileged TCP port number, you will need to be root to do this.
$(ETCDIR)/slapd -f myslapd.conf
ldapsearch -h 127.0.0.1 'objectclass=*'
You are now ready to add more entries (e.g., using ldapadd(3) or another LDAP client), experiment with various configuration options, backend arrangements, etc. Note that by default, the slapd database grants READ access to everybody. So if you want to add or modify entries over LDAP, you will have to bind as the rootdn specified in the config file (see Section 5.2.2), or change the default access control (see Section 5.3).
The following sections provide more detailed information on making, installing, and running slapd.
Send comments about this page to: firstname.lastname@example.org