]> git.sur5r.net Git - openldap/blob - doc/guide/admin/slapdconfig.sdf
Update copyright for next release
[openldap] / doc / guide / admin / slapdconfig.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2009 The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4
5 H1: The slapd Configuration File
6
7 Once the software has been built and installed, you are ready
8 to configure {{slapd}}(8) for use at your site. The slapd
9 runtime configuration is primarily accomplished through the
10 {{slapd.conf}}(5) file, normally installed in the
11 {{EX:/usr/local/etc/openldap}} directory.
12
13 An alternate configuration file location can be specified via a command-line
14 option to {{slapd}}(8). This chapter describes the general format
15 of the {{slapd.conf}}(5) configuration file, followed by a detailed
16 description of commonly used config file directives.
17
18
19 H2: Configuration File Format
20
21 The {{slapd.conf}}(5) file consists of three types of configuration
22 information: global, backend specific, and database specific.  Global
23 information is specified first, followed by information associated
24 with a particular backend type, which is then followed by information
25 associated with a particular database instance.  Global directives can
26 be overridden in backend and/or database directives, and backend directives
27 can be overridden by database directives.
28
29 Blank lines and comment lines beginning with a '{{EX:#}}' character
30 are ignored.  If a line begins with whitespace, it is considered a
31 continuation of the previous line (even if the previous line is a
32 comment).
33
34 The general format of slapd.conf is as follows:
35
36 >       # global configuration directives
37 >       <global config directives>
38 >
39 >       # backend definition
40 >       backend <typeA>
41 >       <backend-specific directives>
42 >
43 >       # first database definition & config directives
44 >       database <typeA>
45 >       <database-specific directives>
46 >
47 >       # second database definition & config directives
48 >       database <typeB>
49 >       <database-specific directives>
50 >
51 >       # second database definition & config directives
52 >       database <typeA>
53 >       <database-specific directives>
54 >
55 >       # subsequent backend & database definitions & config directives
56 >       ...
57
58 A configuration directive may take arguments.  If so, they are
59 separated by whitespace.  If an argument contains whitespace,
60 the argument should be enclosed in double quotes {{EX:"like this"}}. If
61 an argument contains a double quote or a backslash character `{{EX:\}}',
62 the character should be preceded by a backslash character `{{EX:\}}'.
63
64 The distribution contains an example configuration file that will
65 be installed in the {{F: /usr/local/etc/openldap}} directory.
66 A number of files containing schema definitions (attribute types
67 and object classes) are also provided in the
68 {{F: /usr/local/etc/openldap/schema}} directory.
69
70
71 H2: Configuration File Directives
72
73 This section details commonly used configuration directives.  For
74 a complete list, see the {{slapd.conf}}(5) manual page.  This section
75 separates the configuration file directives into global,
76 backend-specific and data-specific categories, describing each
77 directive and its default value (if any), and giving an example of
78 its use.
79
80
81
82 H3: Global Directives
83
84 Directives described in this section apply to all backends
85 and databases unless specifically overridden in a backend or
86 database definition.  Arguments that should be replaced
87 by actual text are shown in brackets {{EX:<>}}.
88
89
90 H4: access to <what> [ by <who> [<accesslevel>] [<control>] ]+
91
92 This directive grants access (specified by <accesslevel>) to a set
93 of entries and/or attributes (specified by <what>) by one or more
94 requestors (specified by <who>).  See the {{SECT:Access Control}} section of 
95 this guide for basic usage.
96
97 !if 0
98 More details discussion of this directive can be found in the
99 {{SECT:Advanced Access Control}} chapter.
100 !endif
101
102 Note: If no {{EX:access}} directives are specified, the default
103 access control policy, {{EX:access to * by * read}}, allows all
104 both authenticated and anonymous users read access.
105
106
107 H4: attributetype <{{REF:RFC4512}} Attribute Type Description>
108
109 This directive defines an attribute type.
110 Please see the {{SECT:Schema Specification}} chapter
111 for information regarding how to use this directive.
112
113 H4: idletimeout <integer>
114
115 Specify the number of seconds to wait before forcibly closing
116 an idle client connection.  An idletimeout of 0, the default,
117 disables this feature.
118
119
120 H4: include <filename>
121
122 This directive specifies that slapd should read additional
123 configuration information from the given file before continuing
124 with the next line of the current file. The included file should
125 follow the normal slapd config file format.  The file is commonly
126 used to include files containing schema specifications.
127
128 Note: You should be careful when using this directive - there is
129 no small limit on the number of nested include directives, and no
130 loop detection is done.
131
132 H4: loglevel <integer>
133
134 This directive specifies the level at which debugging statements
135 and operation statistics should be syslogged (currently logged to
136 the {{syslogd}}(8) {{EX:LOG_LOCAL4}} facility). You must have
137 configured OpenLDAP {{EX:--enable-debug}} (the default) for this
138 to work (except for the two statistics levels, which are always
139 enabled).  Log levels are additive. To display what numbers
140 correspond to what kind of debugging, invoke slapd with {{EX:-d?}}
141 or consult the table below. The possible values for <integer> are:
142
143 !block table; colaligns="RL"; align=Center; \
144         title="Table 6.1: Debugging Levels"
145 Level   Description
146 -1      enable all debugging
147 0       no debugging
148 1       trace function calls
149 2       debug packet handling
150 4       heavy trace debugging
151 8       connection management
152 16      print out packets sent and received
153 32      search filter processing
154 64      configuration file processing
155 128     access control list processing
156 256     stats log connections/operations/results
157 512     stats log entries sent
158 1024    print communication with shell backends
159 2048    print entry parsing debugging
160 !endblock
161
162 \Example:
163
164 E: loglevel -1
165
166 This will cause lots and lots of debugging information to be
167 logged.
168
169 \Default:
170
171 E: loglevel 256
172
173
174 H4: objectclass <{{REF:RFC4512}} Object Class Description>
175
176 This directive defines an object class.
177 Please see the {{SECT:Schema Specification}} chapter for
178 information regarding how to use this directive.
179
180
181 H4: referral <URI>
182
183 This directive specifies the referral to pass back when slapd
184 cannot find a local database to handle a request.
185
186 \Example:
187
188 >       referral ldap://root.openldap.org
189
190 This will refer non-local queries to the global root LDAP server
191 at the OpenLDAP Project. Smart LDAP clients can re-ask their
192 query at that server, but note that most of these clients are
193 only going to know how to handle simple LDAP URLs that
194 contain a host part and optionally a distinguished name part.
195
196
197 H4: sizelimit <integer>
198
199 This directive specifies the maximum number of entries to return
200 from a search operation.
201
202 \Default:
203
204 >       sizelimit 500
205
206 See the {{SECT:Limits}} section of this guide and slapd.conf(5)
207 for more details.
208
209 H4: timelimit <integer>
210
211 This directive specifies the maximum number of seconds (in real
212 time) slapd will spend answering a search request. If a
213 request is not finished in this time, a result indicating an
214 exceeded timelimit will be returned.
215
216 \Default:
217
218 >       timelimit 3600
219
220 See the {{SECT:Limits}} section of this guide and slapd.conf(5)
221 for more details.
222
223
224 H3: General Backend Directives
225
226 Directives in this section apply only to the backend in which
227 they are defined. They are supported by every type of backend.
228 Backend directives apply to all databases instances of the
229 same type and, depending on the directive, may be overridden
230 by database directives.
231
232 H4: backend <type>
233
234 This directive marks the beginning of a backend declaration.
235 {{EX:<type>}} should be one of the
236 supported backend types listed in Table 6.2.
237
238 !block table; align=Center; coltags="EX,N"; \
239         title="Table 5.2: Database Backends"
240 Types   Description
241 bdb     Berkeley DB transactional backend
242 dnssrv  DNS SRV backend
243 hdb     Hierarchical variant of bdb backend
244 ldap    Lightweight Directory Access Protocol (Proxy) backend
245 meta    Meta Directory backend
246 monitor Monitor backend
247 passwd  Provides read-only access to {{passwd}}(5)
248 perl    Perl Programmable backend
249 shell   Shell (extern program) backend
250 sql     SQL Programmable backend
251 !endblock
252
253 \Example:
254
255 >       backend bdb
256
257 This marks the beginning of a new {{TERM:BDB}} backend
258 definition.
259
260
261 H3: General Database Directives
262
263 Directives in this section apply only to the database in which
264 they are defined. They are supported by every type of database.
265
266 H4: database <type>
267
268 This directive marks the beginning of a database instance
269 declaration.
270 {{EX:<type>}} should be one of the
271 supported backend types listed in Table 6.2.
272
273 \Example:
274
275 >       database bdb
276
277 This marks the beginning of a new {{TERM:BDB}} database instance
278 declaration.
279
280
281 H4: limits <who> <limit> [<limit> [...]]
282
283 Specify time and size limits based on who initiated an operation.
284
285 See the {{SECT:Limits}} section of this guide and slapd.conf(5)
286 for more details.
287
288
289 H4: readonly { on | off }
290
291 This directive puts the database into "read-only" mode. Any
292 attempts to modify the database will return an "unwilling to
293 perform" error.
294
295 \Default:
296
297 >       readonly off
298
299
300 H4: rootdn <DN>
301
302 This directive specifies the DN that is not subject to
303 access control or administrative limit restrictions for
304 operations on this database.  The DN need not refer to
305 an entry in this database or even in the directory. The
306 DN may refer to a SASL identity.
307
308 Entry-based Example:
309
310 >       rootdn "cn=Manager,dc=example,dc=com"
311
312 SASL-based Example:
313
314 >       rootdn "uid=root,cn=example.com,cn=digest-md5,cn=auth"
315
316 See the {{SECT:SASL Authentication}} section for information on
317 SASL authentication identities.
318
319
320 H4: rootpw <password>
321
322 This directive can be used to specifies a password for the DN for
323 the rootdn (when the rootdn is set to a DN within the database).
324
325 \Example:
326
327 >       rootpw secret
328
329 It is also permissible to provide hash of the password in {{REF:RFC2307}}
330 form.  {{slappasswd}}(8) may be used to generate the password hash.
331
332 \Example:
333
334 >       rootpw {SSHA}ZKKuqbEKJfKSXhUbHG3fG8MDn9j1v4QN
335
336 The hash was generated using the command {{EX:slappasswd -s secret}}.
337
338
339 H4: suffix <dn suffix>
340
341 This directive specifies the DN suffix of queries that will be
342 passed to this backend database. Multiple suffix lines can be
343 given, and at least one is required for each database
344 definition.
345
346 \Example:
347
348 >       suffix "dc=example,dc=com"
349
350 Queries with a DN ending in "dc=example,dc=com"
351 will be passed to this backend.
352
353 Note: When the backend to pass a query to is selected, slapd
354 looks at the suffix line(s) in each database definition in the
355 order they appear in the file. Thus, if one database suffix is a
356 prefix of another, it must appear after it in the config file.
357
358
359 H4: syncrepl
360
361 >       syncrepl rid=<replica ID>
362 >               provider=ldap[s]://<hostname>[:port]
363 >               [type=refreshOnly|refreshAndPersist]
364 >               [interval=dd:hh:mm:ss]
365 >               [retry=[<retry interval> <# of retries>]+]
366 >               searchbase=<base DN>
367 >               [filter=<filter str>]
368 >               [scope=sub|one|base]
369 >               [attrs=<attr list>]
370 >               [attrsonly]
371 >               [sizelimit=<limit>]
372 >               [timelimit=<limit>]
373 >               [schemachecking=on|off]
374 >               [bindmethod=simple|sasl]
375 >               [binddn=<DN>]
376 >               [saslmech=<mech>]
377 >               [authcid=<identity>]
378 >               [authzid=<identity>]
379 >               [credentials=<passwd>]
380 >               [realm=<realm>]
381 >               [secprops=<properties>]
382 >               [starttls=yes|critical]
383 >               [tls_cert=<file>]
384 >               [tls_key=<file>]
385 >               [tls_cacert=<file>]
386 >               [tls_cacertdir=<path>]
387 >               [tls_reqcert=never|allow|try|demand]
388 >               [tls_ciphersuite=<ciphers>]
389 >               [tls_crlcheck=none|peer|all]
390 >               [logbase=<base DN>]
391 >               [logfilter=<filter str>]
392 >               [syncdata=default|accesslog|changelog]
393
394
395 This directive specifies the current database as a replica of the
396 master content by establishing the current {{slapd}}(8) as a
397 replication consumer site running a syncrepl replication engine.
398 The master database is located at the replication provider site
399 specified by the {{EX:provider}} parameter. The replica database is
400 kept up-to-date with the master content using the LDAP Content
401 Synchronization protocol. See {{REF:RFC4533}}
402 for more information on the protocol.
403
404 The {{EX:rid}} parameter is used for identification of the current
405 {{EX:syncrepl}} directive within the replication consumer server,
406 where {{EX:<replica ID>}} uniquely identifies the syncrepl specification
407 described by the current {{EX:syncrepl}} directive. {{EX:<replica ID>}}
408 is non-negative and is no more than three decimal digits in length.
409
410 The {{EX:provider}} parameter specifies the replication provider site
411 containing the master content as an LDAP URI. The {{EX:provider}}
412 parameter specifies a scheme, a host and optionally a port where the
413 provider slapd instance can be found. Either a domain name or IP
414 address may be used for <hostname>. Examples are
415 {{EX:ldap://provider.example.com:389}} or {{EX:ldaps://192.168.1.1:636}}.
416 If <port> is not given, the standard LDAP port number (389 or 636) is used.
417 Note that the syncrepl uses a consumer-initiated protocol, and hence its
418 specification is located at the consumer site, whereas the {{EX:replica}}
419 specification is located at the provider site. {{EX:syncrepl}} and
420 {{EX:replica}} directives define two independent replication
421 mechanisms. They do not represent the replication peers of each other.
422
423 The content of the syncrepl replica is defined using a search
424 specification as its result set. The consumer slapd will
425 send search requests to the provider slapd according to the search
426 specification. The search specification includes {{EX:searchbase}},
427 {{EX:scope}}, {{EX:filter}}, {{EX:attrs}}, {{EX:attrsonly}},
428 {{EX:sizelimit}}, and {{EX:timelimit}} parameters as in the normal
429 search specification. The {{EX:searchbase}} parameter has no
430 default value and must always be specified. The {{EX:scope}} defaults
431 to {{EX:sub}}, the {{EX:filter}} defaults to {{EX:(objectclass=*)}},
432 {{EX:attrs}} defaults to {{EX:"*,+"}} to replicate all user and operational
433 attributes, and {{EX:attrsonly}} is unset by default. Both {{EX:sizelimit}}
434 and {{EX:timelimit}} default to "unlimited", and only positive integers
435 or "unlimited" may be specified.
436
437 The {{TERM[expand]LDAP Sync}} protocol has two operation
438 types: {{EX:refreshOnly}} and {{EX:refreshAndPersist}}.
439 The operation type is specified by the {{EX:type}} parameter.
440 In the {{EX:refreshOnly}} operation, the next synchronization search operation
441 is periodically rescheduled at an interval time after each
442 synchronization operation finishes. The interval is specified
443 by the {{EX:interval}} parameter. It is set to one day by default.
444 In the {{EX:refreshAndPersist}} operation, a synchronization search
445 remains persistent in the provider {{slapd}} instance. Further updates to the
446 master replica will generate {{EX:searchResultEntry}} to the consumer slapd
447 as the search responses to the persistent synchronization search.
448
449 If an error occurs during replication, the consumer will attempt to reconnect
450 according to the retry parameter which is a list of the <retry interval>
451 and <# of retries> pairs. For example, retry="60 10 300 3" lets the consumer
452 retry every 60 seconds for the first 10 times and then retry every 300 seconds
453 for the next three times before stop retrying. + in <#  of retries> means
454 indefinite number of retries until success.
455
456 The schema checking can be enforced at the LDAP Sync consumer site
457 by turning on the {{EX:schemachecking}} parameter.
458 If it is turned on, every replicated entry will be checked for its
459 schema as the entry is stored into the replica content.
460 Every entry in the replica should contain those attributes
461 required by the schema definition.
462 If it is turned off, entries will be stored without checking
463 schema conformance. The default is off.
464
465 The {{EX:binddn}} parameter gives the DN to bind as for the
466 syncrepl searches to the provider slapd. It should be a DN
467 which has read access to the replication content in the
468 master database. 
469
470 The {{EX:bindmethod}} is {{EX:simple}} or {{EX:sasl}},
471 depending on whether simple password-based authentication or
472 {{TERM:SASL}} authentication is to be used when connecting
473 to the provider {{slapd}} instance.
474
475 Simple authentication should not be used unless adequate data
476 integrity and confidentiality protections are in place (e.g. TLS
477 or IPsec). Simple authentication requires specification of {{EX:binddn}}
478 and {{EX:credentials}} parameters.
479
480 SASL authentication is generally recommended.  SASL authentication
481 requires specification of a mechanism using the {{EX:saslmech}} parameter.
482 Depending on the mechanism, an authentication identity and/or
483 credentials can be specified using {{EX:authcid}} and {{EX:credentials}},
484 respectively.  The {{EX:authzid}} parameter may be used to specify
485 an authorization identity.
486
487 The {{EX:realm}} parameter specifies a realm which a certain
488 mechanisms authenticate the identity within. The {{EX:secprops}}
489 parameter specifies Cyrus SASL security properties.
490
491 The {{EX:starttls}} parameter specifies use of the StartTLS extended
492 operation to establish a TLS session before authenticating to the provider.
493 If the {{EX:critical}} argument is supplied, the session will be aborted
494 if the StartTLS request fails.  Otherwise the syncrepl session continues
495 without TLS.  Note that the main slapd TLS settings are not used by the
496 syncrepl engine; by default the TLS parameters from a {{ldap.conf}}(5)
497 configuration file will be used.  TLS settings may be specified here,
498 in which case any {{ldap.conf}}(5) settings will be completely ignored.
499
500 Rather than replicating whole entries, the consumer can query logs
501 of data modifications.  This mode of operation is referred to as
502 {{delta syncrepl}}.  In addition to the above parameters, the
503 {{EX:logbase}} and {{EX:logfilter}} parameters must be set appropriately
504 for the log that will be used. The {{EX:syncdata}} parameter must
505 be set to either {{EX:"accesslog"}} if the log conforms to the
506 {{slapo-accesslog}}(5) log format, or {{EX:"changelog"}} if the log
507 conforms to the obsolete {{changelog}} format. If the {{EX:syncdata}}
508 parameter is omitted or set to {{EX:"default"}} then the log
509 parameters are ignored.
510
511 The {{syncrepl}} replication mechanism is supported by the {{bdb}} and
512 {{hdb}} backends.
513
514 See the {{SECT:LDAP Sync Replication}} chapter of this guide for
515 more information on how to use this directive.
516
517
518 H4: updateref <URL>
519
520 This directive is only applicable in a {{slave}} (or {{shadow}})
521 {{slapd}}(8) instance. It
522 specifies the URL to return to clients which submit update
523 requests upon the replica.
524 If specified multiple times, each {{TERM:URL}} is provided.
525
526 \Example:
527
528 >       updateref       ldap://master.example.net
529
530
531 H3: BDB and HDB Database Directives
532
533 Directives in this category only apply to both the {{TERM:BDB}}
534 and the {{TERM:HDB}} database.
535 That is, they must follow a "database bdb" or "database hdb" line
536 and come before any
537 subsequent "backend" or "database" line.  For a complete reference
538 of BDB/HDB configuration directives, see {{slapd-bdb}}(5).
539
540
541 H4: directory <directory>
542
543 This directive specifies the directory where the BDB files
544 containing the database and associated indices live.
545
546 \Default:
547
548 >       directory /usr/local/var/openldap-data