2 # Copyright 2005, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
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 runtime configuration in 2.3 is
10 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.d}}(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.
23 An alternate configuration directory (or file) can be specified via a
24 command-line option to {{slapd}}(8) or {{slurpd}}(8). This chapter
25 describes the general format of the configuration system, followed by a
26 detailed description of commonly used config settings.
28 Note: some of the backends and of the distributed overlays
29 do not support runtime configuration yet. In those cases,
30 the old style {{slapd.conf}}(5) file must be used.
32 Note: the current version of {{slurpd}} has not been updated for
33 compatibility with this new configuration engine. If you must use
34 slurpd for replication at your site, you will have to maintain an
35 old-style {{slapd.conf}} file for slurpd to use.
38 H2: Configuration Layout
40 The slapd configuration is stored as a special LDAP directory with
41 a predefined schema and DIT. There are specific objectClasses used to
42 carry global configuration options, schema definitions, backend and
43 database definitions, and assorted other items. A sample config tree
44 is shown in Figure 5.1.
46 !import "config_dit.gif"; align="center"; title="Sample configuration tree"
47 FT[align="Center"] Figure 5.1: Sample configuration tree.
49 Other objects may be part of the configuration but were omitted from
50 the illustration for clarity.
52 The {{slapd.d}} configuration tree has a very specific structure. The
53 root of the tree is named {{EX:cn=config}} and contains global configuration
54 settings. Additional settings are contained in separate child entries:
56 .. Usually these are just pathnames left over from a converted
57 {{EX:slapd.conf}} file.
58 .. Otherwise use of Include files is deprecated.
59 * Dynamically loaded modules
60 .. These may only be used if the {{EX:--enable-modules}} option was
61 used to configure the software.
63 .. The {{EX:cn=schema,cn=config}} entry contains the system schema (all
64 the schema that is hard-coded in slapd).
65 .. Child entries of {{EX:cn=schema,cn=config}} contain user schema as
66 loaded from config files or added at runtime.
67 * Backend-specific configuration
68 * Database-specific configuration
69 .. Overlays are defined in children of the Database entry.
70 .. Databases and Overlays may also have other miscellaneous children.
72 The usual rules for LDIF files apply to the configuration information:
73 Comment lines beginning with a '{{EX:#}}' character
74 are ignored. If a line begins with white space, it is considered a
75 continuation of the previous line (even if the previous line is a
76 comment). Entries are separated by blank lines.
78 The general layout of the config LDIF is as follows:
80 > # global configuration settings
82 > objectClass: olcGlobal
84 > <global config settings>
86 > # schema definitions
87 > dn: cn=schema,cn=config
88 > objectClass: olcSchemaConfig
92 > dn: cn={X}core,cn=schema,cn=config
93 > objectClass: olcSchemaConfig
97 > # additional user-specified schema
100 > # backend definitions
101 > dn: olcBackend=<typeA>,cn=config
102 > objectClass: olcBackendConfig
103 > olcBackend: <typeA>
104 > <backend-specific settings>
106 > # database definitions
107 > dn: olcDatabase={X}<typeA>,cn=config
108 > objectClass: olcDatabaseConfig
109 > olcDatabase: {X}<typeA>
110 > <database-specific settings>
112 > # subsequent definitions and settings
115 Some of the entries listed above have a numeric index {{EX:"{X}"}} in
116 their names. While most configuration settings have an inherent ordering
117 dependency (i.e., one setting must take effect before a subsequent one
118 may be set), LDAP databases are inherently unordered. The numeric index
119 is used to enforce a consistent ordering in the configuration database,
120 so that all ordering dependencies are preserved. In most cases the index
121 does not have to be provided; it will be automatically generated based
122 on the order in which entries are created.
124 Configuration directives are specified as values of individual
126 Most of the attributes and objectClasses used in the slapd
127 configuration have a prefix of {{EX:"olc"}} (OpenLDAP Configuration)
128 in their names. Generally there is a one-to-one correspondence
129 between the attributes and the old-style {{EX:slapd.conf}} configuration
130 keywords, using the keyword as the attribute name, with the "olc"
133 A configuration directive may take arguments. If so, the arguments are
134 separated by white space. If an argument contains white space,
135 the argument should be enclosed in double quotes {{EX:"like this"}}. If
136 an argument contains a double quote or a backslash character `{{EX:\}}',
137 the character should be preceded by a backslash character `{{EX:\}}'.
138 In the descriptions that follow, arguments that should be replaced
139 by actual text are shown in brackets {{EX:<>}}.
141 The distribution contains an example configuration file that will
142 be installed in the {{F: /usr/local/etc/openldap}} directory.
143 A number of files containing schema definitions (attribute types
144 and object classes) are also provided in the
145 {{F: /usr/local/etc/openldap/schema}} directory.
148 H2: Configuration Directives
150 This section details commonly used configuration directives. For
151 a complete list, see the {{slapd.d}}(5) manual page. This section
152 will treat the configuration directives in a top-down order, starting
153 with the global directives in the {{EX:cn=config}} entry. Each
154 directive will be described along with its default value (if any) and
155 an example of its use.
160 Directives contained in this entry generally apply to the server as a whole.
161 Most of them are system or connection oriented, not database related. This
162 entry must have the {{EX:olcGlobal}} objectClass.
165 H4: olcIdleTimeout: <integer>
167 Specify the number of seconds to wait before forcibly closing
168 an idle client connection. A value of 0, the default,
169 disables this feature.
172 H4: olcLogLevel: <level>
174 This directive specifies the level at which debugging statements
175 and operation statistics should be syslogged (currently logged to
176 the {{syslogd}}(8) {{EX:LOG_LOCAL4}} facility). You must have
177 configured OpenLDAP {{EX:--enable-debug}} (the default) for this
178 to work (except for the two statistics levels, which are always
179 enabled). Log levels may be specified as integers or by keyword.
180 Multiple log levels may be used and the levels are additive.
181 To display what levels
182 correspond to what kind of debugging, invoke slapd with {{EX:-?}}
183 or consult the table below. The possible values for <level> are:
185 !block table; colaligns="RL"; align=Center; \
186 title="Table 5.1: Debugging Levels"
187 Level Keyword Description
188 -1 Any enable all debugging
190 1 Trace trace function calls
191 2 Packets debug packet handling
192 4 Args heavy trace debugging
193 8 Conns connection management
194 16 BER print out packets sent and received
195 32 Filter search filter processing
196 64 Config configuration processing
197 128 ACL access control list processing
198 256 Stats stats log connections/operations/results
199 512 Stats2 stats log entries sent
200 1024 Shell print communication with shell backends
201 2048 Parse print entry parsing debugging
202 4096 Cache database cache processing
203 8192 Index database indexing
204 16384 Sync syncrepl consumer processing
211 This will cause lots and lots of debugging information to be
214 E: olcLogLevel: Conns Filter
216 Just log the connection and search filter processing.
220 E: olcLogLevel: Stats
223 H4: olcReferral <URI>
225 This directive specifies the referral to pass back when slapd
226 cannot find a local database to handle a request.
230 > olcReferral: ldap://root.openldap.org
232 This will refer non-local queries to the global root LDAP server
233 at the OpenLDAP Project. Smart LDAP clients can re-ask their
234 query at that server, but note that most of these clients are
235 only going to know how to handle simple LDAP URLs that
236 contain a host part and optionally a distinguished name part.
242 >objectClass: olcGlobal
246 >olcReferral: ldap://root.openldap.org
252 An include entry holds the pathname of one include file. Include files
253 are part of the old style slapd.conf configuration system and must be in
254 slapd.conf format. Include files were commonly used to load schema
255 specifications. While they are still supported, their use is deprecated.
256 Include entries must have the {{EX:olcIncludeFile}} objectClass.
259 H4: olcInclude: <filename>
261 This directive specifies that slapd should read additional
262 configuration information from the given file.
264 Note: You should be careful when using this directive - there is
265 no small limit on the number of nested include directives, and no
266 loop detection is done.
271 >dn: cn=include{0},cn=config
272 >objectClass: olcIncludeFile
274 >olcInclude: ./schema/core.schema
276 >dn: cn=include{1},cn=config
277 >objectClass: olcIncludeFile
279 >olcInclude: ./schema/cosine.schema
284 If support for dynamically loaded modules was enabled when configuring
285 slapd, {{EX:cn=module}} entries may be used to specify sets of modules to load.
286 Module entries must have the {{EX:olcModuleList}} objectClass.
289 H4: olcModuleLoad: <filename>
291 Specify the name of a dynamically loadable module to load. The filename
292 may be an absolute path name or a simple filename. Non-absolute names
293 are searched for in the directories specified by the {{EX:olcModulePath}}
297 H4: olcModulePath: <pathspec>
299 Specify a list of directories to search for loadable modules. Typically the
300 path is colon-separated but this depends on the operating system.
305 >dn: cn=module{0},cn=config
306 >objectClass: olcModuleList
308 >olcModuleLoad: /usr/local/lib/smbk5pwd.la
310 >dn: cn=module{1},cn=config
311 >objectClass: olcModuleList
313 >olcModulePath: /usr/local/lib:/usr/local/lib/slapd
314 >olcModuleLoad: accesslog.la
315 >olcModuleLoad: pcache.la
320 The cn=schema entry holds all of the schema definitions that are hard-coded
321 in slapd. As such, the values in this entry are generated by slapd so no
322 schema values need to be provided in the config file. The entry must still
323 be defined though, to serve as a base for the user-defined schema to add
324 in underneath. Schema entries must have the {{EX:olcSchemaConfig}}
328 H4: olcAttributeTypes: <{{REF:RFC2252}} Attribute Type Description>
330 This directive defines an attribute type.
331 Please see the {{SECT:Schema Specification}} chapter
332 for information regarding how to use this directive.
335 H4: olcObjectClasses: <{{REF:RFC2252}} Object Class Description>
337 This directive defines an object class.
338 Please see the {{SECT:Schema Specification}} chapter for
339 information regarding how to use this directive.
344 >dn: cn=schema,cn=config
345 >objectClass: olcSchemaConfig
348 >dn: cn=test,cn=schema,cn=config
349 >objectClass: olcSchemaConfig
351 >olcAttributeTypes: ( 1.1.1
353 > EQUALITY integerMatch
354 > SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
355 >olcAttributeTypes: ( 1.1.2 NAME 'testTwo' EQUALITY caseIgnoreMatch
356 > SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 )
357 >olcObjectClasses: ( 1.1.3 NAME 'testObject'
358 > MAY ( testAttr $ testTwo ) AUXILIARY )
361 H3: Backend-specific Directives
363 Backend directives apply to all database instances of the
364 same type and, depending on the directive, may be overridden
365 by database directives. Backend entries must have the
366 {{EX:olcBackendConfig}} objectClass.
368 H4: olcBackend: <type>
370 This directive names a backend-specific configuration entry.
371 {{EX:<type>}} should be one of the
372 supported backend types listed in Table 5.2.
374 !block table; align=Center; coltags="EX,N"; \
375 title="Table 5.2: Database Backends"
377 bdb Berkeley DB transactional backend
378 dnssrv DNS SRV backend
379 ldap Lightweight Directory Access Protocol (Proxy) backend
380 ldbm Lightweight DBM backend
381 ldif Lightweight Data Interchange Format backend
382 meta Meta Directory backend
383 monitor Monitor backend
384 passwd Provides read-only access to {{passwd}}(5)
385 perl Perl Programmable backend
386 shell Shell (extern program) backend
387 sql SQL Programmable backend
394 There are no other directives defined for this entry, so generally
395 it will not be needed. However, specific backend types may define
396 additional attributes for their particular use.
401 > dn: olcBackend=bdb,cn=config
402 > objectClass: olcBackendConfig
406 H3: Database-specific Directives
408 Directives in this section are supported by every type of database.
409 Database entries must have the {{EX:olcDatabaseConfig}} objectClass.
411 H4: olcDatabase: [{<index>}]<type>
413 This directive names a specific database instance. The numeric {<index>} may
414 be provided to distinguish multiple databases of the same type. Usually the
415 index can be omitted, and slapd will generate it automatically.
416 {{EX:<type>}} should be one of the
417 supported backend types listed in Table 5.2 or the {{EX:frontend}} type.
419 The {{EX:frontend}} is a special database that is used to hold
420 database-level options that should be applied to all the other
421 databases. Subsequent database definitions may also override some
428 This marks the beginning of a new {{TERM:BDB}} database instance.
431 H4: olcAccess: to <what> [ by <who> <accesslevel> <control> ]+
433 This directive grants access (specified by <accesslevel>) to a
434 set of entries and/or attributes (specified by <what>) by one or
435 more requesters (specified by <who>).
436 See the {{SECT:Access Control}} section of this chapter for a
437 summary of basic usage.
440 More detailed discussion of this directive can be found in the
441 {{SECT:Advanced Access Control}} chapter.
444 Note: If no {{EX:olcAccess}} directives are specified, the default
445 access control policy, {{EX:to * by * read}}, allows all
446 users (both authenticated and anonymous) read access.
448 Note: Access controls defined in the frontend are appended to all
449 other databases' controls.
452 H4: olcReadonly { TRUE | FALSE }
454 This directive puts the database into "read-only" mode. Any
455 attempts to modify the database will return an "unwilling to
465 > olcReplica: uri=ldap[s]://<hostname>[:<port>] | host=<hostname>[:<port>]
466 > [bindmethod={simple|sasl}]
469 > [authcid=<identity>]
470 > [authzid=<identity>]
471 > [credentials=<password>]
473 This directive specifies a replication site for this database for
475 {{EX:uri=}} parameter specifies a scheme, a host and optionally a port where
476 the slave slapd instance can be found. Either a domain name
477 or IP address may be used for <hostname>. If <port> is not
478 given, the standard LDAP port number (389 or 636) is used.
480 {{EX:host}} is deprecated in favor of the {{EX:uri}} parameter.
482 {{EX:uri}} allows the replica LDAP server to be specified as an LDAP
483 URI such as {{EX:ldap://slave.example.com:389}} or
484 {{EX:ldaps://slave.example.com:636}}.
486 The {{EX:binddn=}} parameter gives the DN to bind as for updates
487 to the slave slapd. It should be a DN which has read/write access
488 to the slave slapd's database. It must also match the {{EX:updatedn}}
489 directive in the slave slapd's config file. Generally, this DN
490 {{should not}} be the same as the {{EX:rootdn}} of the master
491 database. Since DNs are likely to contain embedded spaces, the
492 entire {{EX:"binddn=<DN>"}} string should be enclosed in double
495 The {{EX:bindmethod}} is {{EX:simple}} or {{EX:sasl}},
496 depending on whether simple password-based authentication
497 or {{TERM:SASL}} authentication is to be used when connecting
500 Simple authentication should not be used unless adequate data
501 integrity and confidentiality protections are in place (e.g. TLS
502 or IPSEC). Simple authentication requires specification of
503 {{EX:binddn}} and {{EX:credentials}} parameters.
505 SASL authentication is generally recommended. SASL authentication
506 requires specification of a mechanism using the {{EX:saslmech}} parameter.
507 Depending on the mechanism, an authentication identity and/or
508 credentials can be specified using {{EX:authcid}} and {{EX:credentials}}
509 respectively. The {{EX:authzid}} parameter may be used to specify
510 an authorization identity.
512 See the chapter entitled {{SECT:Replication with slurpd}} for more
513 information on how to use this directive.
516 H4: olcReplogfile: <filename>
518 This directive specifies the name of the replication log file to
519 which slapd will log changes. The replication log is typically
520 written by slapd and read by slurpd. Normally, this directive is
521 only used if slurpd is being used to replicate the database.
522 However, you can also use it to generate a transaction log, if
523 slurpd is not running. In this case, you will need to periodically
524 truncate the file, since it will grow indefinitely otherwise.
526 See the chapter entitled {{SECT:Replication with slurpd}} for more
527 information on how to use this directive.
532 This directive specifies the DN that is not subject to
533 access control or administrative limit restrictions for
534 operations on this database. The DN need not refer to
535 an entry in this database or even in the directory. The
536 DN may refer to a SASL identity.
540 > olcRootDN: "cn=Manager,dc=example,dc=com"
544 > olcRootDN: "uid=root,cn=example.com,cn=digest-md5,cn=auth"
546 See the {{SECT:SASL Authentication}} section for information on
547 SASL authentication identities.
550 H4: olcRootPW: <password>
552 This directive can be used to specify a password for the DN for
553 the rootdn (when the rootdn is set to a DN within the database).
559 It is also permissible to provide a hash of the password in RFC 2307
560 form. {{slappasswd}}(8) may be used to generate the password hash.
564 > olcRootPW: {SSHA}ZKKuqbEKJfKSXhUbHG3fG8MDn9j1v4QN
566 The hash was generated using the command {{EX:slappasswd -s secret}}.
569 H4: olcSizeLimit: <integer>
571 This directive specifies the maximum number of entries to return
572 from a search operation.
580 H4: olcSuffix: <dn suffix>
582 This directive specifies the DN suffix of queries that will be
583 passed to this backend database. Multiple suffix lines can be
584 given, and usually at least one is required for each database
585 definition. (Some backend types, such as {{EX:frontend}} and
586 {{EX:monitor}} use a hard-coded suffix which may not be overridden
587 in the configuration.)
591 > olcSuffix: "dc=example,dc=com"
593 Queries with a DN ending in "dc=example,dc=com"
594 will be passed to this backend.
596 Note: When the backend to pass a query to is selected, slapd
597 looks at the suffix value(s) in each database definition in the
598 order in which they were configured. Thus, if one database suffix is a
599 prefix of another, it must appear after it in the configuration.
604 > olcSyncrepl: rid=<replica ID>
605 > provider=ldap[s]://<hostname>[:port]
606 > [type=refreshOnly|refreshAndPersist]
607 > [interval=dd:hh:mm:ss]
608 > [retry=[<retry interval> <# of retries>]+]
609 > [searchbase=<base DN>]
610 > [filter=<filter str>]
611 > [scope=sub|one|base]
612 > [attrs=<attr list>]
614 > [sizelimit=<limit>]
615 > [timelimit=<limit>]
616 > [schemachecking=on|off]
617 > [bindmethod=simple|sasl]
620 > [authcid=<identity>]
621 > [authzid=<identity>]
622 > [credentials=<passwd>]
624 > [secprops=<properties>]
627 This directive specifies the current database as a replica of the
628 master content by establishing the current {{slapd}}(8) as a
629 replication consumer site running a syncrepl replication engine.
630 The master database is located at the replication provider site
631 specified by the {{EX:provider}} parameter. The replica database is
632 kept up-to-date with the master content using the LDAP Content
633 Synchronization protocol. See {{EX:draft-zeilenga-ldup-sync-xx.txt}}
634 ({{a work in progress}}) for more information on the protocol.
636 The {{EX:rid}} parameter is used for identification of the current
637 {{EX:syncrepl}} directive within the replication consumer server,
638 where {{EX:<replica ID>}} uniquely identifies the syncrepl specification
639 described by the current {{EX:syncrepl}} directive. {{EX:<replica ID>}}
640 is non-negative and is no more than three decimal digits in length.
642 The {{EX:provider}} parameter specifies the replication provider site
643 containing the master content as an LDAP URI. The {{EX:provider}}
644 parameter specifies a scheme, a host and optionally a port where the
645 provider slapd instance can be found. Either a domain name or IP
646 address may be used for <hostname>. Examples are
647 {{EX:ldap://provider.example.com:389}} or {{EX:ldaps://192.168.1.1:636}}.
648 If <port> is not given, the standard LDAP port number (389 or 636) is used.
649 Note that the syncrepl uses a consumer-initiated protocol, and hence its
650 specification is located at the consumer site, whereas the {{EX:replica}}
651 specification is located at the provider site. {{EX:syncrepl}} and
652 {{EX:replica}} directives define two independent replication
653 mechanisms. They do not represent the replication peers of each other.
655 The content of the syncrepl replica is defined using a search
656 specification as its result set. The consumer slapd will
657 send search requests to the provider slapd according to the search
658 specification. The search specification includes {{EX:searchbase}},
659 {{EX:scope}}, {{EX:filter}}, {{EX:attrs}}, {{EX:attrsonly}},
660 {{EX:sizelimit}}, and {{EX:timelimit}} parameters as in the normal
661 search specification. The syncrepl search specification has
662 the same value syntax and the same default values as in the
663 {{ldapsearch}}(1) client search tool.
665 The LDAP Content Synchronization protocol has two operation
666 types: {{EX:refreshOnly}} and {{EX:refreshAndPersist}}.
667 The operation type is specified by the {{EX:type}} parameter.
668 In the {{EX:refreshOnly}} operation, the next synchronization search operation
669 is periodically rescheduled at an interval time after each
670 synchronization operation finishes. The interval is specified
671 by the {{EX:interval}} parameter. It is set to one day by default.
672 In the {{EX:refreshAndPersist}} operation, a synchronization search
673 remains persistent in the provider slapd. Further updates to the
674 master replica will generate {{EX:searchResultEntry}} to the consumer slapd
675 as the search responses to the persistent synchronization search.
677 If an error occurs during replication, the consumer will attempt to reconnect
678 according to the retry parameter which is a list of the <retry interval>
679 and <# of retries> pairs. For example, retry="60 10 300 3" lets the consumer
680 retry every 60 seconds for the first 10 times and then retry every 300 seconds
681 for the next three times before stop retrying. + in <# of retries> means
682 indefinite number of retries until success.
684 The schema checking can be enforced at the LDAP Sync consumer site
685 by turning on the {{EX:schemachecking}} parameter.
686 If it is turned on, every replicated entry will be checked for its
687 schema as the entry is stored into the replica content.
688 Every entry in the replica should contain those attributes
689 required by the schema definition.
690 If it is turned off, entries will be stored without checking
691 schema conformance. The default is off.
693 The {{EX:binddn}} parameter gives the DN to bind as for the
694 syncrepl searches to the provider slapd. It should be a DN
695 which has read access to the replication content in the
698 The {{EX:bindmethod}} is {{EX:simple}} or {{EX:sasl}},
699 depending on whether simple password-based authentication or
700 {{TERM:SASL}} authentication is to be used when connecting
701 to the provider slapd.
703 Simple authentication should not be used unless adequate data
704 integrity and confidentiality protections are in place (e.g. TLS
705 or IPSEC). Simple authentication requires specification of {{EX:binddn}}
706 and {{EX:credentials}} parameters.
708 SASL authentication is generally recommended. SASL authentication
709 requires specification of a mechanism using the {{EX:saslmech}} parameter.
710 Depending on the mechanism, an authentication identity and/or
711 credentials can be specified using {{EX:authcid}} and {{EX:credentials}},
712 respectively. The {{EX:authzid}} parameter may be used to specify
713 an authorization identity.
715 The {{EX:realm}} parameter specifies a realm which a certain
716 mechanisms authenticate the identity within. The {{EX:secprops}}
717 parameter specifies Cyrus SASL security properties.
719 The syncrepl replication mechanism is supported by the
720 three native backends: back-bdb, back-hdb, and back-ldbm.
722 See the {{SECT:LDAP Sync Replication}} chapter of the admin guide
723 for more information on how to use this directive.
726 H4: olcTimeLimit: <integer>
728 This directive specifies the maximum number of seconds (in real
729 time) slapd will spend answering a search request. If a
730 request is not finished in this time, a result indicating an
731 exceeded timelimit will be returned.
738 H4: olcUpdateDN: <DN>
740 This directive is only applicable in a slave slapd. It specifies
741 the DN allowed to make changes to the replica. This may be the DN
742 {{slurpd}}(8) binds as when making changes to the replica or the DN
743 associated with a SASL identity.
747 > olcUpdateDN: "cn=Update Daemon,dc=example,dc=com"
751 > olcUpdateDN: "uid=slurpd,cn=example.com,cn=digest-md5,cn=auth"
753 See the {{SECT:Replication with slurpd}} chapter for more information
754 on how to use this directive.
756 H4: olcUpdateref: <URL>
758 This directive is only applicable in a slave slapd. It
759 specifies the URL to return to clients which submit update
760 requests upon the replica.
761 If specified multiple times, each {{TERM:URL}} is provided.
765 > olcUpdateref: ldap://master.example.net
770 >dn: olcDatabase=frontend,cn=config
771 >objectClass: olcDatabaseConfig
772 >olcDatabase: frontend
775 H3: BDB and HDB Database Directives
777 Directives in this category apply to both the {{TERM:BDB}}
778 and the {{TERM:HDB}} database.
779 They are used in an olcDatabase entry in addition to the generic
780 database directives defined above. For a complete reference
781 of BDB/HDB configuration directives, see {{slapd-bdb}}(5). In
782 addition to the {{EX:olcDatabaseConfig}} objectClass, BDB and HDB
783 database entries must have the {{EX:olcBdbConfig}} and
784 {{EX:olcHdbConfig}} objectClass, respectively.
787 H4: olcDbDirectory: <directory>
789 This directive specifies the directory where the BDB files
790 containing the database and associated indices live.
794 > olcDbDirectory: /usr/local/var/openldap-data
797 H4: olcDbCachesize: <integer>
799 This directive specifies the size in entries of the in-memory
800 cache maintained by the BDB backend database instance.
804 > olcDbCachesize: 1000
807 H4: olcDbCheckpoint: <kbyte> <min>
809 This directive specifies how often to checkpoint the BDB transaction log.
810 A checkpoint operation flushes the database buffers to disk and writes a
811 checkpoint record in the log.
812 The checkpoint will occur if either <kbyte> data has been written or
813 <min> minutes have passed since the last checkpont. Both arguments default
814 to zero, in which case they are ignored. When the <min> argument is
815 non-zero, an internal task will run every <min> minutes to perform the
816 checkpoint. See the Berkeley DB reference guide for more details.
820 > olcDbCheckpoint: 1024 10
823 H4: olcDbConfig: <DB_CONFIG setting>
825 This attribute specifies a configuration directive to be placed in the
826 {{EX:DB_CONFIG}} file of the database directory. At server startup time, if
827 no such file exists yet, the {{EX:DB_CONFIG}} file will be created and the
828 settings in this attribute will be written to it. If the file exists,
829 its contents will be read and displayed in this attribute. The attribute
830 is multi-valued, to accomodate multiple configuration directives. No default
831 is provided, but it is essential to use proper settings here to get the
832 best server performance.
836 > olcDbConfig: set_cachesize 0 10485760 0
837 > olcDbConfig: set_lg_bsize 2097512
838 > olcDbConfig: set_lg_dir /var/tmp/bdb-log
839 > olcDbConfig: set_flags DB_LOG_AUTOREMOVE
841 In this example, the BDB cache is set to 10MB, the BDB transaction log
842 buffer size is set to 2MB, and the transaction log files are to be stored
843 in the /var/tmp/bdb-log directory. Also a flag is set to tell BDB to
844 delete transaction log files as soon as their contents have been
845 checkpointed and they are no longer needed. Without this setting the
846 transaction log files will continue to accumulate until some other
847 cleanup procedure removes them. See the SleepyCat documentation for the
848 {{EX:db_archive}} command for details.
850 Ideally the BDB cache must be
851 at least as large as the working set of the database, the log buffer size
852 should be large enough to accomodate most transactions without overflowing,
853 and the log directory must be on a separate physical disk from the main
854 database files. And both the database directory and the log directory
855 should be separate from disks used for regular system activities such as
856 the root, boot, or swap filesystems. See the FAQ-o-Matic and the SleepyCat
857 documentation for more details.
860 H4: olcDbNosync: { TRUE | FALSE }
862 This option causes on-disk database contents to not be immediately
863 synchronized with in memory changes upon change. Setting this option
864 to {{EX:TRUE}} may improve performance at the expense of data integrity. This
865 directive has the same effect as using
866 > olcDbConfig: set_flags DB_TXN_NOSYNC
869 H4: olcDbIDLcacheSize: <integer>
871 Specify the size of the in-memory index cache, in index slots. The
872 default is zero. A larger value will speed up frequent searches of
873 indexed entries. The optimal size will depend on the data and search
874 characteristics of the database, but using a number three times
875 the entry cache size is a good starting point.
879 > olcDbIDLcacheSize: 3000
882 H4: olcDbIndex: {<attrlist> | default} [pres,eq,approx,sub,none]
884 This directive specifies the indices to maintain for the given
885 attribute. If only an {{EX:<attrlist>}} is given, the default
886 indices are maintained.
890 > olcDbIndex: default pres,eq
892 > olcDbIndex: cn,sn pres,eq,sub
893 > olcDbIndex: objectClass eq
895 The first line sets the default set of indices to maintain to
896 present and equality. The second line causes the default (pres,eq)
897 set of indices to be maintained for the {{EX:uid}} attribute type.
898 The third line causes present, equality, and substring indices to
899 be maintained for {{EX:cn}} and {{EX:sn}} attribute types. The
900 fourth line causes an equality index for the {{EX:objectClass}}
903 By default, no indices are maintained. It is generally advised
904 that minimally an equality index upon objectClass be maintained.
906 > olcDbindex: objectClass eq
908 If this setting is changed while slapd is running, an internal task
909 will be run to generate the changed index data. All server operations
910 can continue as normal while the indexer does its work. If slapd is
911 stopped before the index task completes, indexing will have to be
912 manually completed using the slapindex tool.
915 H4: olcDbLinearIndex: { TRUE | FALSE }
917 If this setting is {{EX:TRUE}} slapindex will index one attribute
918 at a time. The default settings is {{EX:FALSE}} in which case all
919 indexed attributes of an entry are processed at the same time. When
920 enabled, each indexed attribute is processed individually, using
921 multiple passes through the entire database. This option improves
922 slapindex performance when the database size exceeds the BDB cache
923 size. When the BDB cache is large enough, this option is not needed
924 and will decrease performance. Also by default, slapadd performs
925 full indexing and so a separate slapindex run is not needed. With
926 this option, slapadd does no indexing and slapindex must be used.
929 H4: olcDbMode: <integer>
931 This directive specifies the file protection mode that newly
932 created database index files should have.
939 H4: olcDbSearchStack: <integer>
941 Specify the depth of the stack used for search filter evaluation.
942 Search filters are evaluated on a stack to accomodate nested {{EX:AND}} /
943 {{EX:OR}} clauses. An individual stack is allocated for each server thread.
944 The depth of the stack determines how complex a filter can be evaluated
945 without requiring any additional memory allocation. Filters that are
946 nested deeper than the search stack depth will cause a separate stack to
947 be allocated for that particular search operation. These separate allocations
948 can have a major negative impact on server performance, but specifying
949 too much stack will also consume a great deal of memory. Each search
950 uses 512K bytes per level on a 32-bit machine, or 1024K bytes per level
951 on a 64-bit machine. The default stack depth is 16, thus 8MB or 16MB
952 per thread is used on 32 and 64 bit machines, respectively. Also the
953 512KB size of a single stack slot is set by a compile-time constant which
954 may be changed if needed; the code must be recompiled for the change
959 > olcDbSearchStack: 16
962 H4: olcDbShmKey: <integer>
964 Specify a key for a shared memory BDB environment. By default the BDB
965 environment uses memory mapped files. If a non-zero value is specified,
966 it will be used as the key to identify a shared memory region that will
967 house the environment.
976 >dn: olcDatabase=hdb,cn=config
977 >objectClass: olcDatabaseConfig
978 >objectClass: olcHdbConfig
980 >olcSuffix: "dc=example,dc=com"
981 >olcDbDirectory: /usr/local/var/openldap-data
982 >olcDbCacheSize: 1000
983 >olcDbCheckpoint: 1024 10
984 >olcDbConfig: set_cachesize 0 10485760 0
985 >olcDbConfig: set_lg_bsize 2097152
986 >olcDbConfig: set_lg_dir /var/tmp/bdb-log
987 >olcDbConfig: set_flags DB_LOG_AUTOREMOVE
988 >olcDbIDLcacheSize: 3000
989 >olcDbIndex: objectClass eq
994 Access to slapd entries and attributes is controlled by the
995 olcAccess attribute, whose values are a sequence of access directives.
996 The general form of the olcAccess configuration is:
998 > olcAccess: <access directive>
999 > <access directive> ::= to <what>
1000 > [by <who> <access> <control>]+
1002 > [dn[.<basic-style>]=<regex> | dn.<scope-style>=<DN>]
1003 > [filter=<ldapfilter>] [attrs=<attrlist>]
1004 > <basic-style> ::= regex | exact
1005 > <scope-style> ::= base | one | subtree | children
1006 > <attrlist> ::= <attr> [val[.<basic-style>]=<regex>] | <attr> , <attrlist>
1007 > <attr> ::= <attrname> | entry | children
1008 > <who> ::= * | [anonymous | users | self
1009 > | dn[.<basic-style>]=<regex> | dn.<scope-style>=<DN>]
1010 > [dnattr=<attrname>]
1011 > [group[/<objectclass>[/<attrname>][.<basic-style>]]=<regex>]
1012 > [peername[.<basic-style>]=<regex>]
1013 > [sockname[.<basic-style>]=<regex>]
1014 > [domain[.<basic-style>]=<regex>]
1015 > [sockurl[.<basic-style>]=<regex>]
1018 > <access> ::= [self]{<level>|<priv>}
1019 > <level> ::= none | auth | compare | search | read | write
1020 > <priv> ::= {=|+|-}{w|r|s|c|x|0}+
1021 > <control> ::= [stop | continue | break]
1023 where the <what> part selects the entries and/or attributes to which
1024 the access applies, the {{EX:<who>}} part specifies which entities
1025 are granted access, and the {{EX:<access>}} part specifies the
1026 access granted. Multiple {{EX:<who> <access> <control>}} triplets
1027 are supported, allowing many entities to be granted different access
1028 to the same set of entries and attributes. Not all of these access
1029 control options are described here; for more details see the
1030 {{slapd.access}}(5) man page.
1033 H3: What to control access to
1035 The <what> part of an access specification determines the entries
1036 and attributes to which the access control applies. Entries are
1037 commonly selected in two ways: by DN and by filter. The following
1038 qualifiers select entries by DN:
1041 > to dn[.<basic-style>]=<regex>
1042 > to dn.<scope-style>=<DN>
1044 The first form is used to select all entries. The second form may
1045 be used to select entries by matching a regular expression against
1046 the target entry's {{normalized DN}}. (The second form is not
1047 discussed further in this document.) The third form is used to
1048 select entries which are within the requested scope of DN. The
1049 <DN> is a string representation of the Distinguished Name, as
1050 described in {{REF:RFC2253}}.
1052 The scope can be either {{EX:base}}, {{EX:one}}, {{EX:subtree}},
1053 or {{EX:children}}. Where {{EX:base}} matches only the entry with
1054 provided DN, {{EX:one}} matches the entries whose parent is the
1055 provided DN, {{EX:subtree}} matches all entries in the subtree whose
1056 root is the provided DN, and {{EX:children}} matches all entries
1057 under the DN (but not the entry named by the DN).
1059 For example, if the directory contained entries named:
1062 > 1: cn=Manager,o=suffix
1063 > 2: ou=people,o=suffix
1064 > 3: uid=kdz,ou=people,o=suffix
1065 > 4: cn=addresses,uid=kdz,ou=people,o=suffix
1066 > 5: uid=hyc,ou=people,o=suffix
1069 . {{EX:dn.base="ou=people,o=suffix"}} match 2;
1070 . {{EX:dn.one="ou=people,o=suffix"}} match 3, and 5;
1071 . {{EX:dn.subtree="ou=people,o=suffix"}} match 2, 3, 4, and 5; and
1072 . {{EX:dn.children="ou=people,o=suffix"}} match 3, 4, and 5.
1075 Entries may also be selected using a filter:
1077 > to filter=<ldap filter>
1079 where <ldap filter> is a string representation of an LDAP
1080 search filter, as described in {{REF:RFC2254}}. For example:
1082 > to filter=(objectClass=person)
1084 Note that entries may be selected by both DN and filter by
1085 including both qualifiers in the <what> clause.
1087 > to dn.one="ou=people,o=suffix" filter=(objectClass=person)
1089 Attributes within an entry are selected by including a comma-separated
1090 list of attribute names in the <what> selector:
1092 > attrs=<attribute list>
1094 A specific value of an attribute is selected by using a single
1095 attribute name and also using a value selector:
1097 > attrs=<attribute> val[.<style>]=<regex>
1099 There are two special {{pseudo}} attributes {{EX:entry}} and
1100 {{EX:children}}. To read (and hence return) a target entry, the
1101 subject must have {{EX:read}} access to the target's {{entry}}
1102 attribute. To add or delete an entry, the subject must have
1103 {{EX:write}} access to the entry's {{EX:entry}} attribute AND must
1104 have {{EX:write}} access to the entry's parent's {{EX:children}}
1105 attribute. To rename an entry, the subject must have {{EX:write}}
1106 access to entry's {{EX:entry}} attribute AND have {{EX:write}}
1107 access to both the old parent's and new parent's {{EX:children}}
1108 attributes. The complete examples at the end of this section should
1109 help clear things up.
1111 Lastly, there is a special entry selector {{EX:"*"}} that is used to
1112 select any entry. It is used when no other {{EX:<what>}}
1113 selector has been provided. It's equivalent to "{{EX:dn=.*}}"
1116 H3: Who to grant access to
1118 The <who> part identifies the entity or entities being granted
1119 access. Note that access is granted to "entities" not "entries."
1120 The following table summarizes entity specifiers:
1122 !block table; align=Center; coltags="EX,N"; \
1123 title="Table 5.3: Access Entity Specifiers"
1125 *|All, including anonymous and authenticated users
1126 anonymous|Anonymous (non-authenticated) users
1127 users|Authenticated users
1128 self|User associated with target entry
1129 dn[.<basic-style>]=<regex>|Users matching a regular expression
1130 dn.<scope-style>=<DN>|Users within scope of a DN
1133 The DN specifier behaves much like <what> clause DN specifiers.
1135 Other control factors are also supported. For example, a {{EX:<who>}}
1136 can be restricted by an entry listed in a DN-valued attribute in
1137 the entry to which the access applies:
1139 > dnattr=<dn-valued attribute name>
1141 The dnattr specification is used to give access to an entry
1142 whose DN is listed in an attribute of the entry (e.g., give
1143 access to a group entry to whoever is listed as the owner of
1146 Some factors may not be appropriate in all environments (or any).
1147 For example, the domain factor relies on IP to domain name lookups.
1148 As these can easily spoofed, the domain factor should not be avoided.
1151 H3: The access to grant
1154 The kind of <access> granted can be one of the following:
1157 !block table; colaligns="LRL"; coltags="EX,EX,N"; align=Center; \
1158 title="Table 5.4: Access Levels"
1159 Level Privileges Description
1161 auth =x needed to bind
1162 compare =cx needed to compare
1163 search =scx needed to apply search filters
1164 read =rscx needed to read search results
1165 write =wrscx needed to modify/rename
1168 Each level implies all lower levels of access. So, for
1169 example, granting someone {{EX:write}} access to an entry also
1170 grants them {{EX:read}}, {{EX:search}}, {{EX:compare}}, and
1171 {{EX:auth}} access. However, one may use the privileges specifier
1172 to grant specific permissions.
1175 H3: Access Control Evaluation
1177 When evaluating whether some requester should be given access to
1178 an entry and/or attribute, slapd compares the entry and/or attribute
1179 to the {{EX:<what>}} selectors given in the configuration.
1180 For each entry, access controls provided in the database which holds
1181 the entry (or the first database if not held in any database) apply
1182 first, followed by the global access directives (which are held in
1183 the {{EX:frontend}} database definition). Within this
1184 priority, access directives are examined in the order in which they
1185 appear in the configuration attribute. Slapd stops with the first {{EX:<what>}}
1186 selector that matches the entry and/or attribute. The corresponding
1187 access directive is the one slapd will use to evaluate access.
1189 Next, slapd compares the entity requesting access to the {{EX:<who>}}
1190 selectors within the access directive selected above in the order
1191 in which they appear. It stops with the first {{EX:<who>}} selector
1192 that matches the requester. This determines the access the entity
1193 requesting access has to the entry and/or attribute.
1195 Finally, slapd compares the access granted in the selected
1196 {{EX:<access>}} clause to the access requested by the client. If
1197 it allows greater or equal access, access is granted. Otherwise,
1200 The order of evaluation of access directives makes their placement
1201 in the configuration file important. If one access directive is
1202 more specific than another in terms of the entries it selects, it
1203 should appear first in the configuration. Similarly, if one {{EX:<who>}}
1204 selector is more specific than another it should come first in the
1205 access directive. The access control examples given below should
1206 help make this clear.
1210 H3: Access Control Examples
1212 The access control facility described above is quite powerful. This
1213 section shows some examples of its use for descriptive purposes.
1217 > olcAccess: to * by * read
1219 This access directive grants read access to everyone.
1226 This directive allows the user to modify their entry, allows anonymous
1227 to authenticate against these entries, and allows all others to
1228 read these entries. Note that only the first {{EX:by <who>}} clause
1229 which matches applies. Hence, the anonymous users are granted
1230 {{EX:auth}}, not {{EX:read}}. The last clause could just as well
1231 have been "{{EX:by users read}}".
1233 It is often desirable to restrict operations based upon the level
1234 of protection in place. The following shows how security strength
1235 factors (SSF) can be used.
1238 > by ssf=128 self write
1239 > by ssf=64 anonymous auth
1240 > by ssf=64 users read
1242 This directive allows users to modify their own entries if security
1243 protections of strength 128 or better have been established,
1244 allows authentication access to anonymous users, and read access
1245 when strength 64 or better security protections have been established. If
1246 the client has not establish sufficient security protections, the
1247 implicit {{EX:by * none}} clause would be applied.
1249 The following example shows the use of style specifiers to select
1250 the entries by DN in two access directives where ordering is
1253 > olcAccess: to dn.children="dc=example,dc=com"
1255 > olcAccess: to dn.children="dc=com"
1258 Read access is granted to entries under the {{EX:dc=com}} subtree,
1259 except for those entries under the {{EX:dc=example,dc=com}} subtree,
1260 to which search access is granted. No access is granted to
1261 {{EX:dc=com}} as neither access directive matches this DN. If the
1262 order of these access directives was reversed, the trailing directive
1263 would never be reached, since all entries under {{EX:dc=example,dc=com}}
1264 are also under {{EX:dc=com}} entries.
1266 Also note that if no {{EX:olcAccess: to}} directive matches or no {{EX:by
1267 <who>}} clause, {{B:access is denied}}. That is, every {{EX:olcAccess:
1268 to}} directive ends with an implicit {{EX:by * none}} clause and
1269 every access list ends with an implicit {{EX:olcAccess: to * by * none}}
1272 The next example again shows the importance of ordering, both of
1273 the access directives and the {{EX:by <who>}} clauses. It also
1274 shows the use of an attribute selector to grant access to a specific
1275 attribute and various {{EX:<who>}} selectors.
1277 > olcAccess: to dn.subtree="dc=example,dc=com" attr=homePhone
1279 > by dn.children=dc=example,dc=com" search
1280 > by peername.regex=IP:10\..+ read
1281 > olcAccess: to dn.subtree="dc=example,dc=com"
1283 > by dn.children="dc=example,dc=com" search
1286 This example applies to entries in the "{{EX:dc=example,dc=com}}"
1287 subtree. To all attributes except {{EX:homePhone}}, an entry can
1288 write to itself, entries under {{EX:example.com}} entries can search
1289 by them, anybody else has no access (implicit {{EX:by * none}})
1290 excepting for authentication/authorization (which is always done
1291 anonymously). The {{EX:homePhone}} attribute is writable by the
1292 entry, searchable by entries under {{EX:example.com}}, readable by
1293 clients connecting from network 10, and otherwise not readable
1294 (implicit {{EX:by * none}}). All other access is denied by the
1295 implicit {{EX:access to * by * none}}.
1297 Sometimes it is useful to permit a particular DN to add or
1298 remove itself from an attribute. For example, if you would like to
1299 create a group and allow people to add and remove only
1300 their own DN from the member attribute, you could accomplish
1301 it with an access directive like this:
1303 > olcAccess: to attr=member,entry
1304 > by dnattr=member selfwrite
1306 The dnattr {{EX:<who>}} selector says that the access applies to
1307 entries listed in the {{EX:member}} attribute. The {{EX:selfwrite}} access
1308 selector says that such members can only add or delete their
1309 own DN from the attribute, not other values. The addition of
1310 the entry attribute is required because access to the entry is
1311 required to access any of the entry's attributes.
1315 H3: Access Control Ordering
1317 Since the ordering of {{EX:olcAccess}} directives is essential to their
1318 proper evaluation, but LDAP attributes normally do not preserve the
1319 ordering of their values, OpenLDAP uses a custom schema extension to
1320 maintain a fixed ordering of these values. This ordering is maintained
1321 by prepending a {{EX:"{X}"}} numeric index to each value, similarly to
1322 the approach used for ordering the configuration entries. These index
1323 tags are maintained automatically by slapd and do not need to be specified
1324 when originally defining the values. For example, when you create the
1327 > olcAccess: to attr=member,entry
1328 > by dnattr=member selfwrite
1329 > olcAccess: to dn.children="dc=example,dc=com"
1331 > olcAccess: to dn.children="dc=com"
1334 when you read them back using slapcat or ldapsearch they will contain
1336 > olcAccess: {0}to attr=member,entry
1337 > by dnattr=member selfwrite
1338 > olcAccess: {1}to dn.children="dc=example,dc=com"
1340 > olcAccess: {2}to dn.children="dc=com"
1343 The numeric index may be used to specify a particular value to change
1344 when using ldapmodify to edit the access rules. This index can be used
1345 instead of (or in addition to) the actual access value. Using this
1346 numeric index is very helpful when multiple access rules are being managed.
1348 For example, if we needed to change the second rule above to grant
1349 write access instead of search, we could try this LDIF:
1351 > changetype: modify
1353 > olcAccess: to dn.children="dc=example,dc=com" by * search
1356 > olcAccess: to dn.children="dc=example,dc=com" by * write
1359 But this example {{B:will not}} guarantee that the existing values remain in
1360 their original order, so it will most likely yield a broken security
1361 configuration. Instead, the numeric index should be used:
1363 > changetype: modify
1368 > olcAccess: {1}to dn.children="dc=example,dc=com" by * write
1371 This example deletes whatever rule is in value #1 of the {{EX:olcAccess}}
1372 attribute (regardless of its value) and adds a new value that is
1373 explicitly inserted as value #1. The result will be
1375 > olcAccess: {0}to attr=member,entry
1376 > by dnattr=member selfwrite
1377 > olcAccess: {1}to dn.children="dc=example,dc=com"
1379 > olcAccess: {2}to dn.children="dc=com"
1382 which is exactly what was intended.
1385 For more details on how to use the {{EX:access}} directive,
1386 consult the {{Advanced Access Control}} chapter.
1390 H2: Configuration Example
1392 The following is an example configuration, interspersed
1393 with explanatory text. It defines two databases to handle
1394 different parts of the {{TERM:X.500}} tree; both are {{TERM:BDB}}
1395 database instances. The line numbers shown are provided for
1396 reference only and are not included in the actual file. First, the
1397 global configuration section:
1399 E: 1. # example config file - global configuration entry
1401 E: 3. objectClass: olcGlobal
1403 E: 5. olcReferral: ldap://root.openldap.org
1406 Line 1 is a comment. Lines 2-4 identify this as the global
1407 configuration entry.
1408 The {{EX:olcReferral:}} directive on line 5
1409 means that queries not local to one of the databases defined
1410 below will be referred to the LDAP server running on the
1411 standard port (389) at the host {{EX:root.openldap.org}}.
1412 Line 6 is a blank line, indicating the end of this entry.
1414 E: 7. # internal schema
1415 E: 8. dn: cn=schema,cn=config
1416 E: 9. objectClass: olcSchemaConfig
1420 Line 7 is a comment. Lines 8-10 identify this as the root of
1421 the schema subtree. The actual schema definitions in this entry
1422 are hardcoded into slapd so no additional attributes are specified here.
1423 Line 11 is a blank line, indicating the end of this entry.
1425 E: 12. # include the core schema
1426 E: 13. include: file:///usr/local/etc/openldap/schema/core.ldif
1429 Line 12 is a comment. Line 13 is an LDIF include directive which
1430 accesses the {{core}} schema definitions in LDIF format. Line 14
1433 Next comes the database definitions. The first database is the
1434 special {{EX:frontend}} database whose settings are applied globally
1435 to all the other databases.
1437 E: 15. # global database parameters
1438 E: 16. dn: olcDatabase=frontend,cn=config
1439 E: 17. objectClass: olcDatabaseConfig
1440 E: 18. olcDatabase: frontend
1441 E: 19. olcAccess: to * by * read
1444 Line 15 is a comment. Lines 16-18 identify this entry as the global
1445 database entry. Line 19 is a global access control. It applies to all
1446 entries (after any applicable database-specific access controls).
1448 The next entry defines a BDB backend that will handle queries for things
1449 in the "dc=example,dc=com" portion of the tree. Indices are to be maintained
1450 for several attributes, and the {{EX:userPassword}} attribute is to be
1451 protected from unauthorized access.
1453 E: 21. # BDB definition for example.com
1454 E: 22. dn: olcDatabase=bdb,cn=config
1455 E: 23. objectClass: olcDatabaseConfig
1456 E: 24. objectClass: olcBdbConfig
1457 E: 25. olcDatabase: bdb
1458 E: 26. olcSuffix: "dc=example,dc=com"
1459 E: 27. olcDbDirectory: /usr/local/var/openldap-data
1460 E: 28. olcRootDN: "cn=Manager,dc=example,dc=com"
1461 E: 29. olcRootPW: secret
1462 E: 30. olcDbIndex: uid pres,eq
1463 E: 31. olcDbIndex: cn,sn,uid pres,eq,approx,sub
1464 E: 32. olcDbIndex: objectClass eq
1465 E: 33. olcAccess: to attr=userPassword
1466 E: 34. by self write
1467 E: 35. by anonymous auth
1468 E: 36. by dn.base="cn=Admin,dc=example,dc=com" write
1470 E: 38. olcAccess: to *
1471 E: 39. by self write
1472 E: 40. by dn.base="cn=Admin,dc=example,dc=com" write
1476 Line 21 is a comment. Lines 22-25 identify this entry as a BDB database
1477 configuration entry. Line 26 specifies the DN suffix
1478 for queries to pass to this database. Line 27 specifies the directory
1479 in which the database files will live.
1481 Lines 28 and 29 identify the database {{super-user}} entry and associated
1482 password. This entry is not subject to access control or size or
1483 time limit restrictions.
1485 Lines 30 through 32 indicate the indices to maintain for various
1488 Lines 33 through 41 specify access control for entries in this
1489 database. As this is the first database, the controls also apply
1490 to entries not held in any database (such as the Root DSE). For
1491 all applicable entries, the {{EX:userPassword}} attribute is writable
1492 by the entry itself and by the "admin" entry. It may be used for
1493 authentication/authorization purposes, but is otherwise not readable.
1494 All other attributes are writable by the entry and the "admin"
1495 entry, but may be read by all users (authenticated or not).
1497 Line 42 is a blank line, indicating the end of this entry.
1499 The next section of the example configuration file defines another
1500 BDB database. This one handles queries involving the
1501 {{EX:dc=example,dc=net}} subtree but is managed by the same entity
1502 as the first database. Note that without line 51, the read access
1503 would be allowed due to the global access rule at line 19.
1505 E: 42. # BDB definition for example.net
1506 E: 43. dn: olcDatabase=bdb,cn=config
1507 E: 44. objectClass: olcDatabaseConfig
1508 E: 45. objectClass: olcBdbConfig
1509 E: 46. olcDatabase: bdb
1510 E: 47. olcSuffix: "dc=example,dc=net"
1511 E: 48. olcDbDirectory: /usr/local/var/openldap-data-net
1512 E: 49. olcRootDN: "cn=Manager,dc=example,dc=com"
1513 E: 50. olcDbIndex: objectClass eq
1514 E: 51. olcAccess: to * by users read