]> git.sur5r.net Git - openldap/blob - doc/guide/admin/quickstart.sdf
Fix up hyperlinks and revamp slapdconfig and misc other sections
[openldap] / doc / guide / admin / quickstart.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4
5 H1: A Quick-Start Guide to Running slapd
6
7 This chapter provides a quick step-by-step guide to building,
8 installing and running {{slapd}}(8). It is intended to provide
9 users with a simple and quick way to get started only.
10 If you intend to run {{slapd}} seriously, you should read the rest
11 of this guide.
12
13
14 Note: This guide does not use strong authentication nor any
15 privacy and integrity protection services.  These services are
16 described in detail in later chapters.
17
18
19 ^{{B:Get the software}}.
20
21 .{{slapd}} is part of the {{PRD:OpenLDAP}} distribution, which
22 you can retrieve from {{URL: http://www.openldap.org/software/download/}}
23 or {{URL: ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release.tgz}}.
24 If you are reading this guide, you have probably already done this.
25
26 .{{S: }}
27 +{{B:Unpack the distribution}}.
28
29 .Pick a directory for the LDAP source to live under and change
30 directory there, and untar it. For example:
31
32 ..{{EX:cd /usr/local/src}}
33 ..{{EX:gunzip -c openldap-release.tgz | tar xvfB -}}
34 ..{{EX:cd openldap-release}}
35
36 . You'll have to replace {{F:openldap-release}} with the full
37 name of the release.
38
39
40 .{{S: }}
41 +{{B: Configure the software}}.
42
43 .You will need to run the {{EX:configure}} script to configure slapd.
44
45 ..{{EX:./configure}}
46
47 . The {{EX:configure}} accepts many command line options that enable
48 or disable optional software features.  Usually the defaults are okay,
49 but you may want to change them.  To get a complete list of options
50 that {{EX:configure}} accepts, use the {{EX:--help}} option.
51
52 ..{{EX:./configure --help}}
53
54 . Once OpenLDAP has been configured, it needs to be compiled.  
55 You'll need to construct dependencies and then compile the software
56 using {{make}}(1) utility.
57 For example:
58
59 ..{{EX:make depend}}
60 ..{{EX:make}}
61
62 . Once OpenLDAP is compiled you need to install it.  By default OpenLDAP 
63 is installed into {{F:/usr/local}}.  This is typically done as root.
64
65 ..{{EX:su root -c 'make install'}}
66
67
68 .{{S: }}
69 +{{B:Edit the configuration file}}.
70
71 .Use this chapter as a brief tutorial.  For more details on the
72 configuration file, see slapd.conf(5) and the
73 {{SECT:The slapd Configuration File}} chapter of this document.
74
75 .Now we need to edit the default configuration file that was
76 installed earlier.  The {{slapd}} configuration file {{slapd.conf}}(5)
77 for is normally located at {{F:/usr/local/etc/openldap/slapd.conf}}.
78 If you specified the {{EX:--prefix}} option when you ran {{EX:configure}},
79 then replace {{F:/usr/local}} with the value you gave as the
80 prefix.  For example, if you ran {{EX:configure}} as
81
82 ..{{EX:./configure --prefix=/opt/ldap}}
83
84 .You would find your configuration file in
85 {{F:/opt/ldap/etc/openldap/slapd.conf}}. 
86 Now look in the configuration file for a line that begins with 
87
88 ..{{EX:database          ldbm}}
89
90 .This marks the beginning of the database configuration for {{slapd}}.
91 Everything you will need to change for this example is located
92 after this line.
93
94 .Listed below are the default settings for the database in
95 {{F:slapd.conf}}(5).  Lines that begin with a sharp sign ('{{EX:#}}')
96 are considered to be comments by slapd, they have been removed
97 from the listing below to save space.  If a line starts with
98 white space it is considered a continuation of the preceding
99 line.
100
101 ..{{EX:suffix          "dc=my-domain, dc=com"}}
102 ..{{EX:rootdn          "cn=Manager, dc=my-domain, dc=com"}}
103 ..{{EX:rootpw          secret}}
104 ..{{EX:directory       /usr/local/var/openldap-ldbm}}
105
106 . Now we need to replace all of the references to {{EX:my-domain}}
107 and {{EX:com}} with the correct value.  For example, if your domain
108 is {{EX:example.net}} we might use the following.
109
110 ..{{EX:suffix          "dc=example, dc=net"}}
111 ..{{EX:rootdn          "cn=Manager, dc=example, dc=net"}}
112 ..{{EX:rootpw          secret}}
113 ..{{EX:directory       /usr/local/var/openldap-ldbm}}
114
115 . By default, the database files will be created in
116 {{F:/usr/local/var/openldap-ldbm}}.
117 You may specify an alternate directory via the directory option
118 in the {{F:slapd.conf}} file.  The directory must exist before
119 you start the server.
120
121 Note: Use of rootpw is deprecated in favor of strong authentication
122 mechanisms.  These are described in later chapters.
123
124 .{{S: }}
125 +{{B:Starting the server}}.
126
127 .You are now ready to start the server by running the command
128 {{slapd}}(8):
129
130 ..{{EX:/usr/local/libexec/slapd}}
131
132 . At this point the LDAP server is up and running, but there isn't
133 any data in the directory.  You can check to see if the server is
134 running and your naming context (the {{EX:suffix}} you specified above)
135 by searching it with {{ldapsearch}}(1).  By default, ldapsearch is
136 installed as {{F:/usr/local/bin/ldapsearch}}.
137
138 ..{{EX:ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts}}
139
140 . Note the use of single quotes around command parameters to prevent
141 special characters from interpreted by the shell.  This should return:
142
143 ..{{EX:dn:}}
144 ..{{EX:namingContexts: dc=example, dc=net}}
145
146
147 .{{S: }}
148 +{{B:Create a database}}.
149
150 . This is a two-step process. The first step is to create a file
151 (we'll call it {{F:example.ldif}}) containing the entries you
152 want your database to contain. Use the following example as a
153 guide, or see {{Database Creation and Maintenance Tools}} section
154 of this document for more details.
155
156 ..{{EX:dn: dc=example, dc=net}}
157 ..{{EX:objectclass: dcObject}}
158 ..{{EX:objectclass: organization}}
159 ..{{EX:o: Example Network}}
160 ..{{EX:dc: example}}
161 ..{{EX: }}
162 ..{{EX:dn: cn=Bob Smith, dc=example, dc=net}}
163 ..{{EX:objectclass: person}}
164 ..{{EX:cn: Bob Smith}}
165 ..{{EX:sn: Smith}}
166
167 .Remember to replace {{EX:dc=example, dc=net}} with the correct
168 values for your site, and to put your name instead of Bob's.  You can
169 include additional entries and attributes in this file if you want,
170 or add them later via LDAP.
171
172 .The second step is to run a tool to add the contents of this file to the
173 your directory.  We use the tool {{ldapadd}}(1) to populate the directory.
174 Again remember to replace {{EX:dc=example, dc=net}} with the correct values
175 for your site.  By default ldapadd is installed as
176 {{F:/usr/local/bin/ldapadd}}.
177
178 ..{{EX:ldapadd -x -D 'cn=Manager,dc=example,dc=net' -w secret -f example.ldif}}
179
180 .Where {{F:example.ldif}} is the file you created above.
181
182 Note: Use of strong authentication and transport security services
183 is highly recommended when updating the directory.  These services
184 are described in later chapters.
185
186
187 .{{S: }}
188 +{{B:See if it works}}.
189
190 .Now we're ready to verify the added entries are in your directory.  
191 You can use any LDAP client to do this, but our example uses the
192 {{ldapsearch}}(1) tool.  Remember to replace {{EX:dc=example,dc=net}}
193 with the correct values for your site.
194
195 ..{{EX:ldapsearch -x -b 'dc=example,dc=net' '(objectclass=*)'}}
196
197 .This command will search for and retrieve every entry in the database.
198
199 You are now ready to add more entries using {{ldapadd}}(1) or
200 another LDAP client, experiment with various configuration options,
201 backend arrangements, etc. Note that by default, the {{slapd}}(8)
202 database grants {{read access to everybody}} excepting the
203 {{super-user}} (as specified by the {{EX:rootdn}} configuration
204 directive).  It is highly recommended that you establish controls
205 to restrict access to authorized users.  Access controls are discussed
206 in the {{SECT:Access Control}} section of the
207 {{SECT:The slapd Configuration File}} chapter.
208
209 The following chapters provide more detailed information on making,
210 installing, and running {{slapd}}(8).
211