]> git.sur5r.net Git - openldap/blob - doc/guide/admin/quickstart.sdf
clarify "by anonymous auth" semantics
[openldap] / doc / guide / admin / quickstart.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2003, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4
5 H1: A Quick-Start Guide
6
7 The following is a quick start guide to OpenLDAP 2.1 software,
8 including the stand-alone LDAP daemon, {{slapd}}(8).
9
10 It is meant to walk you through the basic steps needed to install
11 and configure OpenLDAP Software. It should be used in conjunction
12 with the other chapters of this document, manual pages, and other
13 materials provided with the distribution (e.g. the {{F:INSTALL}}
14 document) or on the OpenLDAP web site (in particular, the OpenLDAP
15 Software {{TERM:FAQ}}).
16
17 If you intend to run OpenLDAP Software seriously, you should review
18 all of this document before attempting to install the software.
19
20 Note: This quick start guide does not use strong authentication
21 nor any integrity or confidential protection services.  These
22 services are described in other chapters of the OpenLDAP Administrator's
23 Guide.
24
25
26 .{{S: }}
27 ^{{B: Get the software}}
28
29 . You can obtain a copy of the software by following the
30 instructions on the OpenLDAP download page
31 ({{URL: http://www.openldap.org/software/download/}}).  It is
32 recommended that new users start with the latest {{release}}.
33
34
35 .{{S: }}
36 +{{B: Unpack the distribution}}
37
38 .Pick a directory for the source to live under, change
39 directory to there, and unpack the distribution using the
40 following commands:
41
42 ..{{EX:gunzip -c openldap-VERSION.tgz | tar xvfB -}}
43
44 . then relocate yourself into the distribution directory:
45
46 ..{{EX:cd openldap-VERSION}}
47
48 . You'll have to replace {{F:VERSION}} with the version
49 name of the release.
50
51
52 .{{S: }}
53 +{{B: Review documentation}}
54
55 . You should now review the {{F:COPYRIGHT}}, {{F:LICENSE}},
56 {{F:README}} and {{F:INSTALL}} documents provided with the distribution.
57 The {{F:COPYRIGHT}} and {{F:LICENSE}} provide information on
58 acceptable use, copying, and limitation of warranty of OpenLDAP
59 software. 
60
61 .{{S: }}
62 . You should also review other chapters of this document.
63 In particular, the {{SECT:Building and Installing OpenLDAP Software}}
64 chapter of this document provides detailed information on prerequisite
65 software and installation procedures.
66
67
68 .{{S: }}
69 +{{B: Run {{EX:configure}}}}
70
71 . You will need to run the provided {{EX:configure}} script to
72 {{configure}} the distribution for building on your system.  The
73 {{EX:configure}} script accepts many command line options that enable or
74 disable optional software features.  Usually the defaults are okay,
75 but you may want to change them.  To get a complete list of options
76 that {{EX:configure}} accepts, use the {{EX:--help}} option:
77
78 ..{{EX:./configure --help}}
79
80 . However, given that you are using this guide, we'll assume you
81 are brave enough to just let {{EX:configure}} determine
82 what's best:
83
84 ..{{EX:./configure}}
85
86 . Assuming {{EX:configure}} doesn't dislike your system, you can
87 proceed with building the software.  If {{EX:configure}} did
88 complain, well, you'll likely need to go to the FAQ Installation
89 Section ({{URL:http://www.openldap.org/faq/}} and/or actually
90 read the {{SECT:Building and Installing OpenLDAP Software}}
91 chapter of this document.
92
93
94 .{{S: }}
95 +{{B:Build the software}}.
96
97 . The next step is to build the software.  This step has two
98 parts, first we construct dependencies and then we compile the
99 software:
100
101 ..{{EX:make depend}}
102 ..{{EX:make}}
103
104
105 . Both makes should complete without error.
106
107
108 .{{S: }}
109 +{{B:Test the build}}.
110
111 . To ensure a correct build, you should run the test suite
112 (it only takes a few minutes):
113
114 ..{{EX:make test}}
115
116 . Tests which apply to your configuration will run and they
117 should pass.  Some tests, such as the replication test, may
118 be skipped.
119
120
121 .{{S: }}
122 +{{B:Install the software}}.
123
124 . You are now ready to install the software; this usually requires
125 {{super-user}} privileges: 
126
127 ..{{EX:su root -c 'make install'}}
128
129 . Everything should now be installed under {{F:/usr/local}} (or
130 whatever installation prefix was used by {{EX:configure}}).
131
132
133 .{{S: }}
134 +{{B:Edit the configuration file}}.
135
136 . Use your favorite editor to edit the provided {{slapd.conf}}(5)
137 example (usually installed as {{F:/usr/local/etc/openldap/slapd.conf}})
138 to contain a BDB database definition of the form:
139
140 ..{{EX:database        bdb}}
141 ..{{EX:suffix          "dc=<MY-DOMAIN>,dc=<COM>"}}
142 ..{{EX:rootdn          "cn=Manager,dc=<MY-DOMAIN>,dc=<COM>"}}
143 ..{{EX:rootpw          secret}}
144 ..{{EX:directory       /usr/local/var/openldap-data}}
145
146 . Be sure to replace {{EX:<MY-DOMAIN>}} and {{EX:<COM>}} with
147 the appropriate domain components of your domain name.  For
148 example, for {{EX:example.com}}, use:
149
150 ..{{EX:database        bdb}}
151 ..{{EX:suffix          "dc=example,dc=com"}}
152 ..{{EX:rootdn          "cn=Manager,dc=example,dc=com"}}
153 ..{{EX:rootpw          secret}}
154 ..{{EX:directory       /usr/local/var/openldap-data}}
155
156 .If your domain contains additional components, such as
157 {{EX:eng.uni.edu.eu}}, use:
158
159 ..{{EX:database        bdb}}
160 ..{{EX:suffix          "dc=eng,dc=uni,dc=edu,dc=eu"}}
161 ..{{EX:rootdn          "cn=Manager,dc=eng,dc=uni,dc=edu,dc=eu"}}
162 ..{{EX:rootpw          secret}}
163 ..{{EX:directory       /usr/local/var/openldap-data}}
164
165 . Details regarding configuring {{slapd}}(8) can be found
166 in the {{slapd.conf}}(5) manual page and the
167 {{SECT:The slapd Configuration File}} chapter of this
168 document.
169
170 Note: the directory specified must exist prior to starting {{slapd}}(8).
171
172
173 .{{S: }}
174 +{{B:Start SLAPD}}.
175
176 . You are now ready to start the stand-alone LDAP server, {{slapd}}(8),
177 by running the command:
178
179 ..{{EX:su root -c /usr/local/libexec/slapd}}
180
181
182 . To check to see if the server is running and configured correctly,
183 you can run a search against it with {{ldapsearch}}(1).  By default,
184 ldapsearch is installed as {{F:/usr/local/bin/ldapsearch}}:
185
186 ..{{EX:ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts}}
187
188 . Note the use of single quotes around command parameters to prevent
189 special characters from being interpreted by the shell.  This should return:
190
191 ..{{EX:dn:}}
192 ..{{EX:namingContexts: dc=example,dc=com}}
193
194 . Details regarding running {{slapd}}(8) can be found
195 in the {{slapd}}(8) manual page and the
196 {{SECT:Running slapd}} chapter of this document.
197
198
199 .{{S: }}
200 +{{B:Add initial entries to your directory}}.
201
202 . You can use {{ldapadd}}(1) to add entries to your LDAP directory.
203 {{ldapadd}} expects input in LDIF form. We'll do it in two steps:
204
205 ^^ create an LDIF file
206 ++ run ldapadd
207
208 . Use your favorite editor and create an LDIF file that contains:
209
210 ..{{EX:dn: dc=<MY-DOMAIN>,dc=<COM>}}
211 ..{{EX:objectclass: dcObject}}
212 ..{{EX:objectclass: organization}}
213 ..{{EX:o: <MY ORGANIZATION>}}
214 ..{{EX:dc: <MY-DOMAIN>}}
215 ..{{EX:}}
216 ..{{EX:dn: cn=Manager,dc=<MY-DOMAIN>,dc=<COM>}}
217 ..{{EX:objectclass: organizationalRole}}
218 ..{{EX:cn: Manager}}
219
220 . Be sure to replace {{EX:<MY-DOMAIN>}} and {{EX:<COM>}} with the
221 appropriate domain components of your domain name.  {{EX:<MY
222 ORGANIZATION>}} should be replaced with the name of your organization.
223 When you cut and paste, be sure to trim any leading and trailing
224 whitespace from the example.
225
226 ..{{EX:dn: dc=example,dc=com}}
227 ..{{EX:objectclass: dcObject}}
228 ..{{EX:objectclass: organization}}
229 ..{{EX:o: Example Company}}
230 ..{{EX:dc: example}}
231 ..{{EX:}}
232 ..{{EX:dn: cn=Manager,dc=example,dc=com}}
233 ..{{EX:objectclass: organizationalRole}}
234 ..{{EX:cn: Manager}}
235
236 . Now, you may run {{ldapadd}}(1) to insert these entries into
237 your directory.
238
239 ..{{EX:ldapadd -x -D "cn=Manager,dc=<MY-DOMAIN>,dc=<COM>" -W -f example.ldif}}
240
241 . Be sure to replace {{EX:<MY-DOMAIN>}} and {{EX:<COM>}} with the
242 appropriate domain components of your domain name.  You will be
243 prompted for the "{{EX:secret}}" specified in {{F:slapd.conf}}. 
244 For example, for {{EX:example.com}}, use:
245
246 ..{{EX:ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f example.ldif}}
247
248 . where {{F:example.ldif}} is the file you created above.
249 ..{{EX: }}
250 . Additional information regarding directory creation can be found
251 in the {{SECT:Database Creation and Maintenance Tools}} chapter of
252 this document.
253
254 .{{S: }}
255 +{{B:See if it works}}.
256
257 . Now we're ready to verify the added entries are in your directory.  
258 You can use any LDAP client to do this, but our example uses the
259 {{ldapsearch}}(1) tool.  Remember to replace {{EX:dc=example,dc=com}}
260 with the correct values for your site:
261
262 ..{{EX:ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'}}
263
264 . This command will search for and retrieve every entry in the database.
265
266 You are now ready to add more entries using {{ldapadd}}(1) or
267 another LDAP client, experiment with various configuration options,
268 backend arrangements, etc.
269
270 Note that by default, the {{slapd}}(8) database grants {{read access
271 to everybody}} excepting the {{super-user}} (as specified by the
272 {{EX:rootdn}} configuration directive).  It is highly recommended
273 that you establish controls to restrict access to authorized users.
274 Access controls are discussed in the {{SECT:Access Control}} section
275 of {{SECT:The slapd Configuration File}} chapter.  You are also
276 encouraged to read the {{SECT:Security Considerations}}, {{SECT:Using
277 SASL}} and {{SECT:Using TLS}} sections.
278
279 The following chapters provide more detailed information on making,
280 installing, and running {{slapd}}(8).