]> git.sur5r.net Git - openldap/blob - doc/guide/admin/slapdconf2.sdf
(ITS#5904) - typo
[openldap] / doc / guide / admin / slapdconf2.sdf
1 # $OpenLDAP$
2 # Copyright 2005-2009 The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4
5 H1: Configuring slapd
6
7 Once the software has been built and installed, you are ready
8 to configure {{slapd}}(8) for use at your site. Unlike previous
9 OpenLDAP releases, the slapd(8) runtime configuration in 2.3 (and later)
10 is fully LDAP-enabled and can be managed using the standard LDAP
11 operations with data in {{TERM:LDIF}}. The LDAP configuration engine
12 allows all of slapd's configuration options to be changed on the fly,
13 generally without requiring a server restart for the changes
14 to take effect. The old style {{slapd.conf}}(5) file is still
15 supported, but must be converted to the new {{slapd-config}}(5) format
16 to allow runtime changes to be saved. While the old style
17 configuration uses a single file, normally installed as
18 {{F:/usr/local/etc/openldap/slapd.conf}}, the new style
19 uses a slapd backend database to store the configuration. The
20 configuration database normally resides in the
21 {{F:/usr/local/etc/openldap/slapd.d}} directory. When
22 converting from the slapd.conf format to slapd.d format, any
23 include files will also be integrated into the resulting configuration
24 database.
25
26 An alternate configuration directory (or file) can be specified via
27 a command-line option to {{slapd}}(8). This chapter describes the
28 general format of the configuration system, followed by a detailed
29 description of commonly used config settings.
30
31 Note: some of the backends and of the distributed overlays
32 do not support runtime configuration yet.  In those cases,
33 the old style {{slapd.conf}}(5) file must be used.
34
35
36 H2: Configuration Layout
37
38 The slapd configuration is stored as a special LDAP directory with
39 a predefined schema and DIT. There are specific objectClasses used to
40 carry global configuration options, schema definitions, backend and
41 database definitions, and assorted other items. A sample config tree
42 is shown in Figure 5.1.
43
44 !import "config_dit.png"; align="center"; title="Sample configuration tree"
45 FT[align="Center"] Figure 5.1: Sample configuration tree.
46
47 Other objects may be part of the configuration but were omitted from
48 the illustration for clarity.
49
50 The {{slapd-config}} configuration tree has a very specific structure. The
51 root of the tree is named {{EX:cn=config}} and contains global configuration
52 settings. Additional settings are contained in separate child entries:
53 * Dynamically loaded modules
54 .. These may only be used if the {{EX:--enable-modules}} option was
55 used to configure the software.
56 * Schema definitions
57 .. The {{EX:cn=schema,cn=config}} entry contains the system schema (all
58 the schema that is hard-coded in slapd).
59 .. Child entries of {{EX:cn=schema,cn=config}} contain user schema as
60 loaded from config files or added at runtime.
61 * Backend-specific configuration 
62 * Database-specific configuration
63 .. Overlays are defined in children of the Database entry.
64 .. Databases and Overlays may also have other miscellaneous children.
65
66 The usual rules for LDIF files apply to the configuration information:
67 Comment lines beginning with a '{{EX:#}}' character
68 are ignored.  If a line begins with a single space, it is considered a
69 continuation of the previous line (even if the previous line is a
70 comment) and the single leading space is removed. Entries are separated by blank lines.
71
72 The general layout of the config LDIF is as follows:
73
74 >       # global configuration settings
75 >       dn: cn=config
76 >       objectClass: olcGlobal
77 >       cn: config
78 >       <global config settings>
79 >
80 >       # schema definitions
81 >       dn: cn=schema,cn=config
82 >       objectClass: olcSchemaConfig
83 >       cn: schema
84 >       <system schema>
85 >
86 >       dn: cn={X}core,cn=schema,cn=config
87 >       objectClass: olcSchemaConfig
88 >       cn: {X}core
89 >       <core schema>
90 >
91 >       # additional user-specified schema
92 >       ...
93 >
94 >       # backend definitions
95 >       dn: olcBackend=<typeA>,cn=config
96 >       objectClass: olcBackendConfig
97 >       olcBackend: <typeA>
98 >       <backend-specific settings>
99 >
100 >       # database definitions
101 >       dn: olcDatabase={X}<typeA>,cn=config
102 >       objectClass: olcDatabaseConfig
103 >       olcDatabase: {X}<typeA>
104 >       <database-specific settings>
105 >
106 >       # subsequent definitions and settings
107 >       ...
108
109 Some of the entries listed above have a numeric index {{EX:"{X}"}} in
110 their names. While most configuration settings have an inherent ordering
111 dependency (i.e., one setting must take effect before a subsequent one
112 may be set), LDAP databases are inherently unordered. The numeric index
113 is used to enforce a consistent ordering in the configuration database,
114 so that all ordering dependencies are preserved. In most cases the index
115 does not have to be provided; it will be automatically generated based
116 on the order in which entries are created.
117
118 Configuration directives are specified as values of individual
119 attributes.
120 Most of the attributes and objectClasses used in the slapd
121 configuration have a prefix of {{EX:"olc"}} (OpenLDAP Configuration)
122 in their names. Generally there is a one-to-one correspondence
123 between the attributes and the old-style {{EX:slapd.conf}} configuration
124 keywords, using the keyword as the attribute name, with the "olc"
125 prefix attached.
126
127 A configuration directive may take arguments.  If so, the arguments are
128 separated by whitespace.  If an argument contains whitespace,
129 the argument should be enclosed in double quotes {{EX:"like this"}}.
130 In the descriptions that follow, arguments that should be replaced
131 by actual text are shown in brackets {{EX:<>}}.
132
133 The distribution contains an example configuration file that will
134 be installed in the {{F: /usr/local/etc/openldap}} directory.
135 A number of files containing schema definitions (attribute types
136 and object classes) are also provided in the
137 {{F: /usr/local/etc/openldap/schema}} directory.
138
139
140 H2: Configuration Directives
141
142 This section details commonly used configuration directives.  For
143 a complete list, see the {{slapd-config}}(5) manual page.  This section
144 will treat the configuration directives in a top-down order, starting
145 with the global directives in the {{EX:cn=config}} entry. Each
146 directive will be described along with its default value (if any) and
147 an example of its use.
148
149
150 H3: cn=config
151
152 Directives contained in this entry generally apply to the server as a whole.
153 Most of them are system or connection oriented, not database related. This
154 entry must have the {{EX:olcGlobal}} objectClass.
155
156
157 H4: olcIdleTimeout: <integer>
158
159 Specify the number of seconds to wait before forcibly closing
160 an idle client connection.  A value of 0, the default,
161 disables this feature.
162
163
164 H4: olcLogLevel: <level>
165
166 This directive specifies the level at which debugging statements
167 and operation statistics should be syslogged (currently logged to
168 the {{syslogd}}(8) {{EX:LOG_LOCAL4}} facility). You must have
169 configured OpenLDAP {{EX:--enable-debug}} (the default) for this
170 to work (except for the two statistics levels, which are always
171 enabled). Log levels may be specified as integers or by keyword.
172 Multiple log levels may be used and the levels are additive.
173 To display what levels
174 correspond to what kind of debugging, invoke slapd with {{EX:-d?}}
175 or consult the table below. The possible values for <level> are:
176
177 !block table; colaligns="RL"; align=Center; \
178         title="Table 5.1: Debugging Levels"
179 Level   Keyword         Description
180 -1      any             enable all debugging
181 0                       no debugging
182 1       (0x1 trace)     trace function callss
183 2       (0x2 packets)   debug packet handling
184 4       (0x4 args)      heavy trace debugging
185 8       (0x8 conns)     connection management
186 16      (0x10 BER)      print out packets sent and received
187 32      (0x20 filter)   search filter processing
188 64      (0x40 config)   configuration processing
189 128     (0x80 ACL)      access control list processing
190 256     (0x100 stats)   stats log connections/operations/results
191 512     (0x200 stats2)  stats log entries sent
192 1024    (0x400 shell)   print communication with shell backends
193 2048    (0x800 parse)   print entry parsing debugging
194 16384   (0x4000 sync)   syncrepl consumer processing
195 32768   (0x8000 none)   only messages that get logged whatever log level is set
196 !endblock
197
198 The desired log level can be input as a single integer that
199 combines the (ORed) desired levels, both in decimal or in hexadecimal 
200 notation, as a list of integers (that are ORed internally), or as a list of the names that are shown between brackets, such that
201
202 >               olcLogLevel 129
203 >               olcLogLevel 0x81
204 >               olcLogLevel 128 1
205 >               olcLogLevel 0x80 0x1
206 >               olcLogLevel acl trace
207
208 are equivalent.
209
210 \Examples:
211
212 E: olcLogLevel -1
213
214 This will cause lots and lots of debugging information to be
215 logged.
216
217 E: olcLogLevel conns filter
218
219 Just log the connection and search filter processing.
220
221 E: olcLogLevel none
222
223 Log those messages that are logged regardless of the configured loglevel. This
224 differs from setting the log level to 0, when no logging occurs. At least the
225 {{EX:None}} level is required to have high priority messages logged.
226
227 \Default:
228
229 E: olcLogLevel stats
230
231 Basic stats logging is configured by default. However, if no olcLogLevel is
232 defined, no logging occurs (equivalent to a 0 level).
233
234
235 H4: olcReferral <URI>
236
237 This directive specifies the referral to pass back when slapd
238 cannot find a local database to handle a request.
239
240 \Example:
241
242 >       olcReferral: ldap://root.openldap.org
243
244 This will refer non-local queries to the global root LDAP server
245 at the OpenLDAP Project. Smart LDAP clients can re-ask their
246 query at that server, but note that most of these clients are
247 only going to know how to handle simple LDAP URLs that
248 contain a host part and optionally a distinguished name part.
249
250
251 H4: Sample Entry
252
253 >dn: cn=config
254 >objectClass: olcGlobal
255 >cn: config
256 >olcIdleTimeout: 30
257 >olcLogLevel: Stats
258 >olcReferral: ldap://root.openldap.org
259
260
261 H3: cn=module
262
263 If support for dynamically loaded modules was enabled when configuring
264 slapd, {{EX:cn=module}} entries may be used to specify sets of modules to load.
265 Module entries must have the {{EX:olcModuleList}} objectClass.
266
267
268 H4: olcModuleLoad: <filename>
269
270 Specify the name of a dynamically loadable module to load. The filename
271 may be an absolute path name or a simple filename. Non-absolute names
272 are searched for in the directories specified by the {{EX:olcModulePath}}
273 directive.
274
275
276 H4: olcModulePath: <pathspec>
277
278 Specify a list of directories to search for loadable modules. Typically the
279 path is colon-separated but this depends on the operating system.
280
281
282 H4: Sample Entries
283
284 >dn: cn=module{0},cn=config
285 >objectClass: olcModuleList
286 >cn: module{0}
287 >olcModuleLoad: /usr/local/lib/smbk5pwd.la
288 >
289 >dn: cn=module{1},cn=config
290 >objectClass: olcModuleList
291 >cn: module{1}
292 >olcModulePath: /usr/local/lib:/usr/local/lib/slapd
293 >olcModuleLoad: accesslog.la
294 >olcModuleLoad: pcache.la
295
296
297 H3: cn=schema
298
299 The cn=schema entry holds all of the schema definitions that are hard-coded
300 in slapd. As such, the values in this entry are generated by slapd so no
301 schema values need to be provided in the config file. The entry must still
302 be defined though, to serve as a base for the user-defined schema to add
303 in underneath. Schema entries must have the {{EX:olcSchemaConfig}}
304 objectClass.
305
306
307 H4: olcAttributeTypes: <{{REF:RFC4512}} Attribute Type Description>
308
309 This directive defines an attribute type.
310 Please see the {{SECT:Schema Specification}} chapter
311 for information regarding how to use this directive.
312
313
314 H4: olcObjectClasses: <{{REF:RFC4512}} Object Class Description>
315
316 This directive defines an object class.
317 Please see the {{SECT:Schema Specification}} chapter for
318 information regarding how to use this directive.
319
320
321 H4: Sample Entries
322
323 >dn: cn=schema,cn=config
324 >objectClass: olcSchemaConfig
325 >cn: schema
326 >
327 >dn: cn=test,cn=schema,cn=config
328 >objectClass: olcSchemaConfig
329 >cn: test
330 >olcAttributeTypes: ( 1.1.1
331 >  NAME 'testAttr'
332 >  EQUALITY integerMatch
333 >  SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
334 >olcAttributeTypes: ( 1.1.2 NAME 'testTwo' EQUALITY caseIgnoreMatch
335 >  SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 )
336 >olcObjectClasses: ( 1.1.3 NAME 'testObject'
337 >  MAY ( testAttr $ testTwo ) AUXILIARY )
338
339
340 H3: Backend-specific Directives
341
342 Backend directives apply to all database instances of the
343 same type and, depending on the directive, may be overridden
344 by database directives. Backend entries must have the
345 {{EX:olcBackendConfig}} objectClass.
346
347 H4: olcBackend: <type>
348
349 This directive names a backend-specific configuration entry.
350 {{EX:<type>}} should be one of the
351 supported backend types listed in Table 5.2.
352
353 !block table; align=Center; coltags="EX,N"; \
354         title="Table 5.2: Database Backends"
355 Types   Description
356 bdb     Berkeley DB transactional backend
357 config  Slapd configuration backend
358 dnssrv  DNS SRV backend
359 hdb     Hierarchical variant of bdb backend
360 ldap    Lightweight Directory Access Protocol (Proxy) backend
361 ldif    Lightweight Data Interchange Format backend
362 meta    Meta Directory backend
363 monitor Monitor backend
364 passwd  Provides read-only access to {{passwd}}(5)
365 perl    Perl Programmable backend
366 shell   Shell (extern program) backend
367 sql     SQL Programmable backend
368 !endblock
369
370 \Example:
371
372 >       olcBackend: bdb
373
374 There are no other directives defined for this entry.  Specific backend
375 types may define additional attributes for their particular use but so
376 far none have ever been defined.  As such, these directives usually do
377 not appear in any actual configurations.
378
379
380 H4: Sample Entry
381
382 > dn: olcBackend=bdb,cn=config
383 > objectClass: olcBackendConfig
384 > olcBackend: bdb
385
386
387 H3: Database-specific Directives
388
389 Directives in this section are supported by every type of database.
390 Database entries must have the {{EX:olcDatabaseConfig}} objectClass.
391
392 H4: olcDatabase: [{<index>}]<type>
393
394 This directive names a specific database instance. The numeric {<index>} may
395 be provided to distinguish multiple databases of the same type. Usually the
396 index can be omitted, and slapd will generate it automatically.
397 {{EX:<type>}} should be one of the
398 supported backend types listed in Table 5.2 or the {{EX:frontend}} type.
399
400 The {{EX:frontend}} is a special database that is used to hold
401 database-level options that should be applied to all the other
402 databases. Subsequent database definitions may also override some
403 frontend settings.
404
405 The {{EX:config}} database is also special; both the {{EX:config}} and
406 the {{EX:frontend}} databases are always created implicitly even if they
407 are not explicitly configured, and they are created before any other
408 databases.
409
410 \Example:
411
412 >       olcDatabase: bdb
413
414 This marks the beginning of a new {{TERM:BDB}} database instance.
415
416
417 H4: olcAccess: to <what> [ by <who> [<accesslevel>] [<control>] ]+
418
419 This directive grants access (specified by <accesslevel>) to a
420 set of entries and/or attributes (specified by <what>) by one or
421 more requestors (specified by <who>).
422 See the {{SECT:Access Control}} section of this guide for basic usage.
423
424 !if 0
425 More detailed discussion of this directive can be found in the
426 {{SECT:Advanced Access Control}} chapter.
427 !endif
428
429 Note: If no {{EX:olcAccess}} directives are specified, the default
430 access control policy, {{EX:to * by * read}}, allows all
431 users (both authenticated and anonymous) read access.
432
433 Note: Access controls defined in the frontend are appended to all
434 other databases' controls.
435
436
437 H4: olcReadonly { TRUE | FALSE }
438
439 This directive puts the database into "read-only" mode. Any
440 attempts to modify the database will return an "unwilling to
441 perform" error.
442
443 \Default:
444
445 >       olcReadonly: FALSE
446
447
448 H4: olcRootDN: <DN>
449
450 This directive specifies the DN that is not subject to
451 access control or administrative limit restrictions for
452 operations on this database.  The DN need not refer to
453 an entry in this database or even in the directory. The
454 DN may refer to a SASL identity.
455
456 Entry-based Example:
457
458 >       olcRootDN: "cn=Manager,dc=example,dc=com"
459
460 SASL-based Example:
461
462 >       olcRootDN: "uid=root,cn=example.com,cn=digest-md5,cn=auth"
463
464 See the {{SECT:SASL Authentication}} section for information on
465 SASL authentication identities.
466
467
468 H4: olcRootPW: <password>
469
470 This directive can be used to specify a password for the DN for
471 the rootdn (when the rootdn is set to a DN within the database).
472
473 \Example:
474
475 >       olcRootPW: secret
476
477 It is also permissible to provide a hash of the password in
478 {{REF:RFC2307}} form.  {{slappasswd}}(8) may be used to generate
479 the password hash.
480
481 \Example:
482
483 >       olcRootPW: {SSHA}ZKKuqbEKJfKSXhUbHG3fG8MDn9j1v4QN
484
485 The hash was generated using the command {{EX:slappasswd -s secret}}.
486
487
488 H4: olcSizeLimit: <integer>
489
490 This directive specifies the maximum number of entries to return
491 from a search operation.
492
493 \Default:
494
495 >       olcSizeLimit: 500
496
497 See the {{SECT:Limits}} section of this guide and slapd-config(5)
498 for more details.
499
500
501 H4: olcSuffix: <dn suffix>
502
503 This directive specifies the DN suffix of queries that will be
504 passed to this backend database. Multiple suffix lines can be
505 given, and usually at least one is required for each database
506 definition. (Some backend types, such as {{EX:frontend}} and
507 {{EX:monitor}} use a hard-coded suffix which may not be overridden
508 in the configuration.)
509
510 \Example:
511
512 >       olcSuffix: "dc=example,dc=com"
513
514 Queries with a DN ending in "dc=example,dc=com"
515 will be passed to this backend.
516
517 Note: When the backend to pass a query to is selected, slapd
518 looks at the suffix value(s) in each database definition in the
519 order in which they were configured. Thus, if one database suffix is a
520 prefix of another, it must appear after it in the configuration.
521
522
523 H4: olcSyncrepl
524
525 >       olcSyncrepl: rid=<replica ID>
526 >               provider=ldap[s]://<hostname>[:port]
527 >               [type=refreshOnly|refreshAndPersist]
528 >               [interval=dd:hh:mm:ss]
529 >               [retry=[<retry interval> <# of retries>]+]
530 >               searchbase=<base DN>
531 >               [filter=<filter str>]
532 >               [scope=sub|one|base]
533 >               [attrs=<attr list>]
534 >               [attrsonly]
535 >               [sizelimit=<limit>]
536 >               [timelimit=<limit>]
537 >               [schemachecking=on|off]
538 >               [bindmethod=simple|sasl]
539 >               [binddn=<DN>]
540 >               [saslmech=<mech>]
541 >               [authcid=<identity>]
542 >               [authzid=<identity>]
543 >               [credentials=<passwd>]
544 >               [realm=<realm>]
545 >               [secprops=<properties>]
546 >               [starttls=yes|critical]
547 >               [tls_cert=<file>]
548 >               [tls_key=<file>]
549 >               [tls_cacert=<file>]
550 >               [tls_cacertdir=<path>]
551 >               [tls_reqcert=never|allow|try|demand]
552 >               [tls_ciphersuite=<ciphers>]
553 >               [tls_crlcheck=none|peer|all]
554 >               [logbase=<base DN>]
555 >               [logfilter=<filter str>]
556 >               [syncdata=default|accesslog|changelog]
557
558
559 This directive specifies the current database as a replica of the
560 master content by establishing the current {{slapd}}(8) as a
561 replication consumer site running a syncrepl replication engine.
562 The master database is located at the replication provider site
563 specified by the {{EX:provider}} parameter. The replica database is
564 kept up-to-date with the master content using the LDAP Content
565 Synchronization protocol. See {{REF:RFC4533}}
566 for more information on the protocol.
567
568 The {{EX:rid}} parameter is used for identification of the current
569 {{EX:syncrepl}} directive within the replication consumer server,
570 where {{EX:<replica ID>}} uniquely identifies the syncrepl specification
571 described by the current {{EX:syncrepl}} directive. {{EX:<replica ID>}}
572 is non-negative and is no more than three decimal digits in length.
573
574 The {{EX:provider}} parameter specifies the replication provider site
575 containing the master content as an LDAP URI. The {{EX:provider}}
576 parameter specifies a scheme, a host and optionally a port where the
577 provider slapd instance can be found. Either a domain name or IP
578 address may be used for <hostname>. Examples are
579 {{EX:ldap://provider.example.com:389}} or {{EX:ldaps://192.168.1.1:636}}.
580 If <port> is not given, the standard LDAP port number (389 or 636) is used.
581 Note that the syncrepl uses a consumer-initiated protocol, and hence its
582 specification is located at the consumer site, whereas the {{EX:replica}}
583 specification is located at the provider site. {{EX:syncrepl}} and
584 {{EX:replica}} directives define two independent replication
585 mechanisms. They do not represent the replication peers of each other.
586
587 The content of the syncrepl replica is defined using a search
588 specification as its result set. The consumer slapd will
589 send search requests to the provider slapd according to the search
590 specification. The search specification includes {{EX:searchbase}},
591 {{EX:scope}}, {{EX:filter}}, {{EX:attrs}}, {{EX:attrsonly}},
592 {{EX:sizelimit}}, and {{EX:timelimit}} parameters as in the normal
593 search specification. The {{EX:searchbase}} parameter has no
594 default value and must always be specified. The {{EX:scope}} defaults
595 to {{EX:sub}}, the {{EX:filter}} defaults to {{EX:(objectclass=*)}},
596 {{EX:attrs}} defaults to {{EX:"*,+"}} to replicate all user and operational
597 attributes, and {{EX:attrsonly}} is unset by default. Both {{EX:sizelimit}}
598 and {{EX:timelimit}} default to "unlimited", and only positive integers
599 or "unlimited" may be specified.
600
601 The {{TERM[expand]LDAP Sync}} protocol has two operation
602 types: {{EX:refreshOnly}} and {{EX:refreshAndPersist}}.
603 The operation type is specified by the {{EX:type}} parameter.
604 In the {{EX:refreshOnly}} operation, the next synchronization search operation
605 is periodically rescheduled at an interval time after each
606 synchronization operation finishes. The interval is specified
607 by the {{EX:interval}} parameter. It is set to one day by default.
608 In the {{EX:refreshAndPersist}} operation, a synchronization search
609 remains persistent in the provider {{slapd}} instance. Further updates to the
610 master replica will generate {{EX:searchResultEntry}} to the consumer slapd
611 as the search responses to the persistent synchronization search.
612
613 If an error occurs during replication, the consumer will attempt to reconnect
614 according to the retry parameter which is a list of the <retry interval>
615 and <# of retries> pairs. For example, retry="60 10 300 3" lets the consumer
616 retry every 60 seconds for the first 10 times and then retry every 300 seconds
617 for the next three times before stop retrying. + in <#  of retries> means
618 indefinite number of retries until success.
619
620 The schema checking can be enforced at the LDAP Sync consumer site
621 by turning on the {{EX:schemachecking}} parameter.
622 If it is turned on, every replicated entry will be checked for its
623 schema as the entry is stored into the replica content.
624 Every entry in the replica should contain those attributes
625 required by the schema definition.
626 If it is turned off, entries will be stored without checking
627 schema conformance. The default is off.
628
629 The {{EX:binddn}} parameter gives the DN to bind as for the
630 syncrepl searches to the provider slapd. It should be a DN
631 which has read access to the replication content in the
632 master database. 
633
634 The {{EX:bindmethod}} is {{EX:simple}} or {{EX:sasl}},
635 depending on whether simple password-based authentication or
636 {{TERM:SASL}} authentication is to be used when connecting
637 to the provider {{slapd}} instance.
638
639 Simple authentication should not be used unless adequate data
640 integrity and confidentiality protections are in place (e.g. TLS
641 or IPsec). Simple authentication requires specification of {{EX:binddn}}
642 and {{EX:credentials}} parameters.
643
644 SASL authentication is generally recommended.  SASL authentication
645 requires specification of a mechanism using the {{EX:saslmech}} parameter.
646 Depending on the mechanism, an authentication identity and/or
647 credentials can be specified using {{EX:authcid}} and {{EX:credentials}},
648 respectively.  The {{EX:authzid}} parameter may be used to specify
649 an authorization identity.
650
651 The {{EX:realm}} parameter specifies a realm which a certain
652 mechanisms authenticate the identity within. The {{EX:secprops}}
653 parameter specifies Cyrus SASL security properties.
654
655 The {{EX:starttls}} parameter specifies use of the StartTLS extended
656 operation to establish a TLS session before authenticating to the provider.
657 If the {{EX:critical}} argument is supplied, the session will be aborted
658 if the StartTLS request fails.  Otherwise the syncrepl session continues
659 without TLS.  Note that the main slapd TLS settings are not used by the
660 syncrepl engine; by default the TLS parameters from a {{ldap.conf}}(5)
661 configuration file will be used.  TLS settings may be specified here,
662 in which case any {{ldap.conf}}(5) settings will be completely ignored.
663
664 Rather than replicating whole entries, the consumer can query logs
665 of data modifications.  This mode of operation is referred to as
666 {{delta syncrepl}}.  In addition to the above parameters, the
667 {{EX:logbase}} and {{EX:logfilter}} parameters must be set appropriately
668 for the log that will be used. The {{EX:syncdata}} parameter must
669 be set to either {{EX:"accesslog"}} if the log conforms to the
670 {{slapo-accesslog}}(5) log format, or {{EX:"changelog"}} if the log
671 conforms to the obsolete {{changelog}} format. If the {{EX:syncdata}}
672 parameter is omitted or set to {{EX:"default"}} then the log
673 parameters are ignored.
674
675 The {{syncrepl}} replication mechanism is supported by the {{bdb}} and
676 {{hdb}} backends.
677
678 See the {{SECT:LDAP Sync Replication}} chapter of this guide for
679 more information on how to use this directive.
680
681
682 H4: olcTimeLimit: <integer>
683
684 This directive specifies the maximum number of seconds (in real
685 time) slapd will spend answering a search request. If a
686 request is not finished in this time, a result indicating an
687 exceeded timelimit will be returned.
688
689 \Default:
690
691 >       olcTimeLimit: 3600
692
693 See the {{SECT:Limits}} section of this guide and slapd-config(5)
694 for more details.
695
696
697 H4: olcUpdateref: <URL>
698
699 This directive is only applicable in a slave slapd. It
700 specifies the URL to return to clients which submit update
701 requests upon the replica.
702 If specified multiple times, each {{TERM:URL}} is provided.
703
704 \Example:
705
706 >       olcUpdateref:   ldap://master.example.net
707
708
709 H4: Sample Entries
710
711 >dn: olcDatabase=frontend,cn=config
712 >objectClass: olcDatabaseConfig
713 >objectClass: olcFrontendConfig
714 >olcDatabase: frontend
715 >olcReadOnly: FALSE
716 >
717 >dn: olcDatabase=config,cn=config
718 >objectClass: olcDatabaseConfig
719 >olcDatabase: config
720 >olcRootDN: cn=Manager,dc=example,dc=com
721
722
723 H3: BDB and HDB Database Directives
724
725 Directives in this category apply to both the {{TERM:BDB}}
726 and the {{TERM:HDB}} database.
727 They are used in an olcDatabase entry in addition to the generic
728 database directives defined above.  For a complete reference
729 of BDB/HDB configuration directives, see {{slapd-bdb}}(5). In
730 addition to the {{EX:olcDatabaseConfig}} objectClass, BDB and HDB
731 database entries must have the {{EX:olcBdbConfig}} and
732 {{EX:olcHdbConfig}} objectClass, respectively.
733
734
735 H4: olcDbDirectory: <directory>
736
737 This directive specifies the directory where the BDB files
738 containing the database and associated indices live.
739
740 \Default:
741
742 >       olcDbDirectory: /usr/local/var/openldap-data
743
744
745 H4: olcDbCachesize: <integer>
746
747 This directive specifies the size in entries of the in-memory
748 cache maintained by the BDB backend database instance.
749
750 \Default:
751
752 >       olcDbCachesize: 1000
753
754
755 H4: olcDbCheckpoint: <kbyte> <min>
756
757 This directive specifies how often to checkpoint the BDB transaction log.
758 A checkpoint operation flushes the database buffers to disk and writes a
759 checkpoint record in the log.
760 The checkpoint will occur if either <kbyte> data has been written or
761 <min> minutes have passed since the last checkpoint. Both arguments default
762 to zero, in which case they are ignored. When the <min> argument is
763 non-zero, an internal task will run every <min> minutes to perform the
764 checkpoint. See the Berkeley DB reference guide for more details.
765
766 \Example:
767
768 >       olcDbCheckpoint: 1024 10
769
770
771 H4: olcDbConfig: <DB_CONFIG setting>
772
773 This attribute specifies a configuration directive to be placed in the
774 {{EX:DB_CONFIG}} file of the database directory. At server startup time, if
775 no such file exists yet, the {{EX:DB_CONFIG}} file will be created and the
776 settings in this attribute will be written to it. If the file exists,
777 its contents will be read and displayed in this attribute. The attribute
778 is multi-valued, to accommodate multiple configuration directives. No default
779 is provided, but it is essential to use proper settings here to get the
780 best server performance.
781
782 Any changes made to this attribute will be written to the {{EX:DB_CONFIG}}
783 file and will cause the database environment to be reset so the changes
784 can take immediate effect. If the environment cache is large and has not
785 been recently checkpointed, this reset operation may take a long time. It
786 may be advisable to manually perform a single checkpoint using the Berkeley DB
787 {{db_checkpoint}} utility before using LDAP Modify to change this
788 attribute.
789
790 \Example:
791
792 >       olcDbConfig: set_cachesize 0 10485760 0
793 >       olcDbConfig: set_lg_bsize 2097512
794 >       olcDbConfig: set_lg_dir /var/tmp/bdb-log
795 >       olcDbConfig: set_flags DB_LOG_AUTOREMOVE
796
797 In this example, the BDB cache is set to 10MB, the BDB transaction log
798 buffer size is set to 2MB, and the transaction log files are to be stored
799 in the /var/tmp/bdb-log directory. Also a flag is set to tell BDB to
800 delete transaction log files as soon as their contents have been
801 checkpointed and they are no longer needed. Without this setting the
802 transaction log files will continue to accumulate until some other
803 cleanup procedure removes them. See the Berkeley DB documentation for the
804 {{EX:db_archive}} command for details. For a complete list of Berkeley DB 
805 flags please see - {{URL:http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_set_flags.html}}
806
807 Ideally the BDB cache must be
808 at least as large as the working set of the database, the log buffer size
809 should be large enough to accommodate most transactions without overflowing,
810 and the log directory must be on a separate physical disk from the main
811 database files. And both the database directory and the log directory
812 should be separate from disks used for regular system activities such as
813 the root, boot, or swap filesystems. See the FAQ-o-Matic and the Berkeley DB
814 documentation for more details.
815
816
817 H4: olcDbNosync: { TRUE | FALSE }
818
819 This option causes on-disk database contents to not be immediately
820 synchronized with in memory changes upon change.  Setting this option
821 to {{EX:TRUE}} may improve performance at the expense of data integrity. This
822 directive has the same effect as using
823 >       olcDbConfig: set_flags DB_TXN_NOSYNC
824
825
826 H4: olcDbIDLcacheSize: <integer>
827
828 Specify the size of the in-memory index cache, in index slots. The
829 default is zero. A larger value will speed up frequent searches of
830 indexed entries. The optimal size will depend on the data and search
831 characteristics of the database, but using a number three times
832 the entry cache size is a good starting point.
833
834 \Example:
835
836 >       olcDbIDLcacheSize: 3000
837
838
839 H4: olcDbIndex: {<attrlist> | default} [pres,eq,approx,sub,none]
840
841 This directive specifies the indices to maintain for the given
842 attribute. If only an {{EX:<attrlist>}} is given, the default
843 indices are maintained. The index keywords correspond to the
844 common types of matches that may be used in an LDAP search filter.
845
846 \Example:
847
848 >       olcDbIndex: default pres,eq
849 >       olcDbIndex: uid
850 >       olcDbIndex: cn,sn pres,eq,sub
851 >       olcDbIndex: objectClass eq
852
853 The first line sets the default set of indices to maintain to
854 present and equality.  The second line causes the default (pres,eq)
855 set of indices to be maintained for the {{EX:uid}} attribute type.
856 The third line causes present, equality, and substring indices to
857 be maintained for {{EX:cn}} and {{EX:sn}} attribute types.  The
858 fourth line causes an equality index for the {{EX:objectClass}}
859 attribute type.
860
861 There is no index keyword for inequality matches. Generally these
862 matches do not use an index. However, some attributes do support
863 indexing for inequality matches, based on the equality index.
864
865 A substring index can be more explicitly specified as {{EX:subinitial}},
866 {{EX:subany}}, or {{EX:subfinal}}, corresponding to the three 
867 possible components
868 of a substring match filter. A subinitial index only indexes
869 substrings that appear at the beginning of an attribute value.
870 A subfinal index only indexes substrings that appear at the end
871 of an attribute value, while subany indexes substrings that occur
872 anywhere in a value.
873
874 Note that by default, setting an index for an attribute also
875 affects every subtype of that attribute. E.g., setting an equality
876 index on the {{EX:name}} attribute causes {{EX:cn}}, {{EX:sn}}, and every other
877 attribute that inherits from {{EX:name}} to be indexed.
878
879 By default, no indices are maintained.  It is generally advised
880 that minimally an equality index upon objectClass be maintained.
881
882 >       olcDbindex: objectClass eq
883
884 Additional indices should be configured corresponding to the
885 most common searches that are used on the database.
886 Presence indexing should not be configured for an attribute
887 unless the attribute occurs very rarely in the database, and
888 presence searches on the attribute occur very frequently during
889 normal use of the directory. Most applications don't use presence
890 searches, so usually presence indexing is not very useful.
891
892 If this setting is changed while slapd is running, an internal task
893 will be run to generate the changed index data. All server operations
894 can continue as normal while the indexer does its work.  If slapd is
895 stopped before the index task completes, indexing will have to be
896 manually completed using the slapindex tool.
897
898
899 H4: olcDbLinearIndex: { TRUE | FALSE }
900
901 If this setting is {{EX:TRUE}} slapindex will index one attribute
902 at a time. The default settings is {{EX:FALSE}} in which case all
903 indexed attributes of an entry are processed at the same time. When
904 enabled, each indexed attribute is processed individually, using
905 multiple passes through the entire database. This option improves
906 slapindex performance when the database size exceeds the BDB cache
907 size. When the BDB cache is large enough, this option is not needed
908 and will decrease performance. Also by default, slapadd performs
909 full indexing and so a separate slapindex run is not needed. With
910 this option, slapadd does no indexing and slapindex must be used.
911
912
913 H4: olcDbMode: { <octal> | <symbolic> }
914
915 This directive specifies the file protection mode that newly
916 created database index files should have. This can be in the form
917 {{EX:0600}} or {{EX:-rw-------}}
918
919 \Default:
920
921 >       olcDbMode: 0600
922
923
924 H4: olcDbSearchStack: <integer>
925
926 Specify the depth of the stack used for search filter evaluation.
927 Search filters are evaluated on a stack to accommodate nested {{EX:AND}} /
928 {{EX:OR}} clauses. An individual stack is allocated for each server thread.
929 The depth of the stack determines how complex a filter can be evaluated
930 without requiring any additional memory allocation. Filters that are
931 nested deeper than the search stack depth will cause a separate stack to
932 be allocated for that particular search operation. These separate allocations
933 can have a major negative impact on server performance, but specifying
934 too much stack will also consume a great deal of memory. Each search
935 uses 512K bytes per level on a 32-bit machine, or 1024K bytes per level
936 on a 64-bit machine. The default stack depth is 16, thus 8MB or 16MB
937 per thread is used on 32 and 64 bit machines, respectively. Also the
938 512KB size of a single stack slot is set by a compile-time constant which
939 may be changed if needed; the code must be recompiled for the change
940 to take effect.
941
942 \Default:
943
944 >       olcDbSearchStack: 16
945
946
947 H4: olcDbShmKey: <integer>
948
949 Specify a key for a shared memory BDB environment. By default the BDB
950 environment uses memory mapped files. If a non-zero value is specified,
951 it will be used as the key to identify a shared memory region that will
952 house the environment.
953
954 \Example:
955
956 >       olcDbShmKey: 42
957
958
959 H4: Sample Entry
960
961 >dn: olcDatabase=hdb,cn=config
962 >objectClass: olcDatabaseConfig
963 >objectClass: olcHdbConfig
964 >olcDatabase: hdb
965 >olcSuffix: "dc=example,dc=com"
966 >olcDbDirectory: /usr/local/var/openldap-data
967 >olcDbCacheSize: 1000
968 >olcDbCheckpoint: 1024 10
969 >olcDbConfig: set_cachesize 0 10485760 0
970 >olcDbConfig: set_lg_bsize 2097152
971 >olcDbConfig: set_lg_dir /var/tmp/bdb-log
972 >olcDbConfig: set_flags DB_LOG_AUTOREMOVE
973 >olcDbIDLcacheSize: 3000
974 >olcDbIndex: objectClass eq