2 # Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
5 H1: The slapd Configuration File
7 Once the software has been built and installed, you are ready
8 to configure {{slapd}}(8) for use at your site. The slapd
9 runtime configuration is primarily accomplished through the
10 {{slapd.conf}}(5) file, normally installed in the
11 {{EX:/usr/local/etc/openldap}} directory.
13 An alternate configuration file can be specified via a
14 command-line option to {{slapd}}(8) or {{slurpd}}(8). This chapter
15 describes the general format of the config file, followed by a
16 detailed description of commonly used config file directives.
19 H2: Configuration File Format
21 The {{slapd.conf}}(5) file consists of three types of configuration
22 information: global, backend specific, and database specific. Global
23 information is specified first, followed by information associated
24 with a particular backend type, which is then followed by information
25 associated with a particular database instance. Global directives can
26 be overridden in a backend and/or database directives, backend directives
27 can be overridden by database directives.
29 Blank lines and comment lines beginning with a '{{EX:#}}' character
30 are ignored. If a line begins with white space, it is considered a
31 continuation of the previous line. The general format of slapd.conf is
34 > # global configuration directives
35 > <global config directives>
37 > # backend definition
39 > <backend-specific directives>
41 > # first database definition & config directives
43 > <database-specific directives>
45 > # second database definition & config directives
47 > <database-specific directives>
49 > # second database definition & config directives
51 > <database-specific directives>
53 > # subsequent backend & database definitions & config directives
56 A configuration directive may take arguments. If so, they are
57 separated by white space. If an argument contains white space,
58 the argument should be enclosed in double quotes {{EX:"like this"}}. If
59 an argument contains a double quote or a backslash character `{{EX:\}}',
60 the character should be preceded by a backslash character `{{EX:\}}'.
62 The distribution contains an example configuration file that will
63 be installed in the {{F: /usr/local/etc/openldap}} directory.
64 A number of files containing schema definitions (attribute types
65 and object classes) are also provided in the
66 {{F: /usr/local/etc/openldap/schema}} directory.
69 H2: Configuration File Directives
71 This section details commonly used configuration directives. For
72 a complete list, see {{slapd.conf}}(5) manual page. This section
73 separates the configuration file directives into global,
74 backend-specific and data-specific categories, describing each
75 directive and its default value (if any), and giving an example of
82 Directives described in this section apply to all backends
83 and databases unless specifically overridden in a backend or
84 database definition. Arguments that should be replaced
85 by actual text are shown in brackets {{EX:<>}}.
88 H4: access to <what> [ by <who> <accesslevel> <control> ]+
90 This directive grants access (specified by <accesslevel>) to a
91 set of entries and/or attributes (specified by <what>) by one or
92 more requesters (specified by <who>).
93 See the {{SECT:Access Control}} section of this chapter for a
94 summary of basic usage.
96 More details discussion of this directive can be found in the
97 {{SECT:Advanced Access Control}} chapter.
101 H4: attributetype <{{REF:RFC2252}} Attribute Type Description>
103 This directive defines an attribute type.
104 Please see the {{SECT:Schema Specification}} chapter
105 for information regarding how to use this directive.
107 H4: defaultaccess { none | compare | search | read | write }
109 This directive specifies the default access to grant requesters
110 when no {{EX:access}} directives have been specified. Any given
111 access level implies all lesser access levels (e.g., read access
112 implies search and compare but not write).
114 Note: It is recommend that the {{EX:access}} directive be used
115 to specify access control. See the {{SECT:Access Control}}
116 section of this chapter for information regarding the {{EX:access}}
121 E: defaultaccess read
124 H4: idletimeout <integer>
126 Specify the number of seconds to wait before forcibly closing
127 an idle client connection. An idletimeout of 0, the default,
128 disables this feature.
131 H4: include <filename>
133 This directive specifies that slapd should read additional
134 configuration information from the given file before continuing
135 with the next line of the current file. The included file should
136 follow the normal slapd config file format. The file is commonly
137 used to include files containing schema specifications.
139 Note: You should be careful when using this directive - there is
140 no small limit on the number of nested include directives, and no
141 loop detection is done.
143 H4: loglevel <integer>
145 This directive specifies the level at which debugging statements
146 and operation statistics should be syslogged (currently logged to
147 the {{syslogd}}(8) {EX:LOG_LOCAL4}} facility). You must have
148 configured OpenLDAP {{EX:--enable-debug}} (the default) for this
149 to work (except for the two statistics levels, which are always
150 enabled). Log levels are additive. To display what numbers
151 correspond to what kind of debugging, invoke slapd with {{EX:-?}}
152 or consult the table below. The possible values for <integer> are:
154 !block table; colaligns="RL"; align=Center; \
155 title="Table 5.1: Debugging Levels"
157 -1 enable all debugging
159 1 trace function calls
160 2 debug packet handling
161 4 heavy trace debugging
162 8 connection management
163 16 print out packets sent and received
164 32 search filter processing
165 64 configuration file processing
166 128 access control list processing
167 256 stats log connections/operations/results
168 512 stats log entries sent
169 1024 print communication with shell backends
170 2048 print entry parsing debugging
177 This will cause lots and lots of debugging information to be
185 H4: objectclass <{{REF:RFC2252}} Object Class Description>
187 This directive defines an object class.
188 Please see the {{SECT:Schema Specification}} chapter for
189 information regarding how to use this directive.
194 This directive specifies the referral to pass back when slapd
195 cannot find a local database to handle a request.
199 > referral ldap://root.openldap.org
201 This will refer non-local queries to the global root LDAP server
202 at the OpenLDAP Project. Smart LDAP clients can re-ask their
203 query at that server, but note that most of these clients are
204 only going to know how to handle simple LDAP URLs that
205 contain a host part and optionally a distinguished name part.
208 H4: sizelimit <integer>
210 This directive specifies the maximum number of entries to return
211 from a search operation.
218 H4: timelimit <integer>
220 This directive specifies the maximum number of seconds (in real
221 time) slapd will spend answering a search request. If a
222 request is not finished in this time, a result indicating an
223 exceeded timelimit will be returned.
230 H3: General Backend Directives
232 Directives in this section apply only to the backend in which
233 they are defined. They are supported by every type of backend.
234 Backend directives apply to all databases instances of the
235 same type and, depending on the directive, may be overridden
236 by database directives.
240 This directive marks the beginning of a backend definition.
241 {{EX:<type>}} should be one of {{EX:ldbm}}, {{EX:shell}},
242 {{EX:passwd}}, or other supported backend type.
245 H3: General Database Directives
247 Directives in this section apply only to the database in which
248 they are defined. They are supported by every type of database.
252 This directive marks the beginning of a new database instance
254 {{EX:<type>}} should be one of {{EX:ldbm}}, {{EX:shell}},
255 {{EX:passwd}}, or other supported database type.
261 This marks the beginning of a new LDBM backend database
265 H4: readonly { on | off }
267 This directive puts the database into "read-only" mode. Any
268 attempts to modify the database will return an "unwilling to
277 > replica host=<hostname>[:<port>]
278 > [bindmethod={ simple | kerberos | sasl }]
281 > [authcid=<identity>]
282 > [authzid=<identity>]
283 > [credentials=<password>]
284 > [srvtab=<filename>]
286 This directive specifies a replication site for this database. The
287 {{EX:host=}} parameter specifies a host and optionally a port where
288 the slave slapd instance can be found. Either a domain name
289 or IP address may be used for <hostname>. If <port> is not
290 given, the standard LDAP port number (389) is used.
292 The {{EX:binddn=}} parameter gives the DN to bind as for updates to
293 the slave slapd. It should be a DN which has read/write
294 access to the slave slapd's database, typically given as a
295 {{EX:rootdn}} in the slave's config file. It must also match the
296 {{EX:updatedn}} directive in the slave slapd's config file. Since DNs are
297 likely to contain embedded spaces, the entire {{EX:"binddn=<DN>"}}
298 string should be enclosed in double quotes.
300 The {{EX:bindmethod}} is {{EX:simple}} or {{EX:kerberos}} or {{EX:sasl}},
301 depending on whether simple password-based authentication or Kerberos
302 authentication or {{TERM:SASL}} authentication is to be used when connecting
305 Simple authentication should not be used unless adequate integrity
306 and privacy protections are in place (e.g. TLS or IPSEC). Simple
307 authentication requires specification of {{EX:binddn}} and
308 {{EX:credentials}} parameters.
310 Kerberos authentication is deprecated in favor of SASL authentication
311 mechanisms, in particular the {{EX:KERBEROS_V4}} and {{EX:GSSAPI}}
312 mechanisms. Kerberos authentication requires {{EX:binddn}} and
313 {{EX:srvtab}} parameters.
315 SASL authentication is generally recommended. SASL authentication
316 requires specification of a mechanism using the {{EX:mech}} parameter.
317 Depending on the mechanism, an authentication identity and/or
318 credentials can be specified using {{EX:authcid}} and {{EX:credentials}}
319 respectively. The {{EX:authzid}} parameter may be used to specify
320 an authorization identity.
322 See the chapter entitled {{SECT:Replication with slurpd}} for more
323 information on how to use this directive.
326 H4: replogfile <filename>
328 This directive specifies the name of the replication log file to
329 which slapd will log changes. The replication log is typically
330 written by slapd and read by slurpd. Normally, this directive is
331 only used if slurpd is being used to replicate the database.
332 However, you can also use it to generate a transaction log, if
333 slurpd is not running. In this case, you will need to periodically
334 truncate the file, since it will grow indefinitely otherwise.
336 See the chapter entitled {{SECT:Replication with slurpd}} for more
337 information on how to use this directive.
342 This directive specifies the DN that is not subject to
343 access control or administrative limit restrictions for
344 operations on this database. The DN need not refer to
345 an entry in the directory. The DN may refer to a SASL
350 > rootdn "cn=Manager,dc=example,dc=com"
354 > rootdn "uid=root@EXAMPLE.COM"
357 H4: rootpw <password>
359 This directive specifies a password for the DN given above that
360 will always work, regardless of whether an entry with the given
361 DN exists or has a password.
362 This directive is deprecated in favor of SASL based authentication.
369 H4: suffix <dn suffix>
371 This directive specifies the DN suffix of queries that will be
372 passed to this backend database. Multiple suffix lines can be
373 given, and at least one is required for each database
378 > suffix "dc=example,dc=com"
380 Queries with a DN ending in "dc=example,dc=com"
381 will be passed to this backend.
383 Note: When the backend to pass a query to is selected, slapd
384 looks at the suffix line(s) in each database definition in the
385 order they appear in the file. Thus, if one database suffix is a
386 prefix of another, it must appear after it in the config file.
390 This directive is only applicable in a slave slapd. It specifies
391 the DN allowed to make changes to the replica. This may be the DN
392 {{slurpd}}(8) binds as when making changes to the replica or the DN
393 associated with a SASL identity.
397 > updatedn "cn=Update Daemon,dc=example,dc=com"
401 > updatedn "uid=slurpd@EXAMPLE.COM"
403 See the {{SECT:Replication}} chapter for more information on how to
408 This directive is only applicable in a slave slapd. It
409 specifies the URL to return to clients which submit update
410 requests upon the replica.
411 If specified multiple times, each {{TERM:URL}} is provided.
415 > updateref ldap://master.example.net
418 H3: LDBM Backend-Specific Directives
420 Directives in this category only apply to the LDBM backend
421 database. That is, they must follow a "database ldbm" line and
422 come before any other "database" line.
424 H4: cachesize <integer>
426 This directive specifies the size in entries of the in-memory
427 cache maintained by the LDBM backend database instance.
434 H4: dbcachesize <integer>
436 This directive specifies the size in bytes of the in-memory cache
437 associated with each open index file. If not supported by the
438 underlying database method, this directive is ignored without
439 comment. Increasing this number uses more memory but can
440 cause a dramatic performance increase, especially during
441 modifies or when building indexes.
450 This option, if present, disables database locking.
451 Enabling this option may improve performance at the expense
457 This option causes on-disk database contents not be immediately
458 synchronized with in memory changes upon change. Enabling this option
459 may improve performance at the expense of data security.
462 H4: directory <directory>
464 This directive specifies the directory where the LDBM files
465 containing the database and associated indexes live.
469 > directory /usr/local/var/openldap-ldbm
472 H4: index {<attrlist> | default} [pres,eq,approx,sub,none]
474 This directive specifies the indexes to maintain for the given
475 attribute. If only an {{EX:<attrlist>}} is given, the default
476 indexes are maintained.
481 > index default pres,eq
482 > index objectClass,uid
483 > index cn,sn eq,sub,approx
485 The first line sets the default set of indices to maintain to present
486 and equality. The second line causes the default (pres,eq) set
487 of indices to be maintained for {{EX:objectClass}} and {{EX:uid}} attribute
488 types. The third line causes equality, substring, and approximate
489 indices to be maintained for {{EX:cn}} and {{EX:sn}} attribute types.
493 This directive specifies the file protection mode that newly
494 created database index files should have.
502 H3: Other Backend Databases
504 {{slapd}}(8) supports a number of backend database types besides the default LDBM.
506 !block table; align=Center; coltags="EX,N"; \
507 title="Table 5.2: Backend Database Types"
509 ldbm Berkeley or GNU DBM compatible backend
510 passwd Provides read-only access to {{F:/etc/passwd}}
511 shell Shell (extern program) backend
512 sql SQL Programmable backend
515 See {{slapd.conf}}(5) for details.
521 Access to slapd entries and attributes is controlled by the
522 access configuration file directive. The general form of an
525 > <access directive> ::= access to <what>
526 > [by <who> <access> <control>]+
527 > <what> ::= * | [ dn[.<target style>]=<regex>]
528 > [filter=<ldapfilter>] [attrs=<attrlist>]
529 > <target style> ::= regex | base | one | subtree | children
530 > <attrlist> ::= <attr> | <attr> , <attrlist>
531 > <attr> ::= <attrname> | entry | children
532 > <who> ::= [* | anonymous | users | self |
533 > dn[.<subject style>]=<regex>]
534 > [dnattr=<attrname> ]
535 > [group[/<objectclass>[/<attrname>][.<basic style>]]=<regex> ]
536 > [peername[.<basic style>]=<regex>]
537 > [sockname[.<basic style>]=<regex>]
538 > [domain[.<basic style>]=<regex>]
539 > [sockurl[.<basic style>]=<regex>]
542 > <subject style> ::= regex | exact | base | one | subtree | children
543 > <basic style> ::= regex | exact
544 > <access> ::= [self]{<level>|<priv>}
545 > <level> ::= none | auth | compare | search | read | write
546 > <priv> ::= {=|+|-}{w|r|s|c|x}+
547 > <control> ::= [stop | continue | break]
549 where the <what> part selects the entries and/or attributes to
550 which the access applies, the {{EX:<who>}} part specifies which
551 entities are granted access, and the {{EX:<access>}} part specifies
552 the access granted. Multiple {{EX:<who> <access> <control>}} triplets
553 are supported, allowing many entities to be granted different
554 access to the same set of entries and attributes.
557 H3: What to control access to
559 The <what> part of an access specification determines the
560 entries and attributes to which the access control applies.
561 Entries can be selected in two ways: by a regular expression
562 matching the entry's distinguished name:
564 > dn=<regular expression>
566 Note: The DN pattern specified should be "normalized" to the RFC2253
567 restricted DN form. In particular, there should be no extra spaces
568 and commas should be used to separate components. An example
569 normalized DN is "{{EX:cn=Babs Jensen,dc=example,dc=com}}". An
570 example of a non-normalized DN is "{{EX:cn=Babs Jensen; dc=example;
573 Or, entries may be selected by a filter matching some
574 attribute(s) in the entry:
576 > filter=<ldap filter>
578 where <ldap filter> is a string representation of an LDAP
579 search filter, as described in {{REF:RFC2254}}.
581 Attributes within an entry are selected by including a
582 comma-separated list of attribute names in the <what>
585 > attrs=<attribute list>
587 Access to the entry itself must be granted or denied using the
588 special attribute name "{{EX:entry}}". Note that giving access to an
589 attribute is not enough; access to the entry itself through the
590 {{EX:entry}} attribute is also required. The complete examples at
591 the end of this section should help clear things up.
593 Lastly, there is a special entry selector {{EX:"*"}} that is used to
594 select any entry. It is used when no other {{EX:<what>}}
595 selector has been provided. It's equivalent to "{{EX:dn=.*}}"
598 H3: Who to grant access to
600 The <who> part identifies the entity or entities being granted
601 access. Note that access is granted to "entities" not "entries."
602 The following table summarizes entity specifiers:
604 !block table; align=Center; coltags="EX,N"; \
605 title="Table 5.3: Access Entity Specifiers"
607 * All, including anonymous and authenticated users
608 anonymous Anonymous (non-authenticated) users
609 users Authenticated users
610 self User associated with target entry
611 dn=<regex> Users matching regular expression
614 The DN specifier takes a regular expression which is used
615 to match against the "normalized" DN of the current entity.
617 > dn=<regular expression>
619 By "normalized", we mean that all extra spaces have been
620 removed from the entity's DN and commas are used to
621 separate RDN components.
623 Other control factors are also supported.
624 For example, a {{EX:<what>}} can be restricted by a
625 regular expression matching the client's domain name:
627 > domain=<regular expression>
629 or by an entry listed in a DN-valued attribute in the entry to
630 which the access applies:
632 > dnattr=<dn-valued attribute name>
634 The dnattr specification is used to give access to an entry
635 whose DN is listed in an attribute of the entry (e.g., give
636 access to a group entry to whoever is listed as the owner of
640 H3: The access to grant
643 The kind of <access> granted can be one of the following:
646 !block table; colaligns="LRL"; coltags="EX,EX,N"; align=Center; \
647 title="Table 5.4: Access Levels"
648 Level Privileges Description
650 auth =x needed to bind
651 compare =cx needed to compare
652 search =scx needed to apply search filters
653 read =rscx needed to read search results
654 write =wrscx needed to modify/rename
657 Each level implies all lower levels of access. So, for
658 example, granting someone {{EX:write}} access to an entry also
659 grants them {{EX:read}}, {{EX:search}}, {{EX:compare}}, and
660 {{EX:auth}} access. However, one may use the privileges specifier
661 to grant specific permissions.
664 H3: Access Control Evaluation
666 When evaluating whether some requester should be given access to
667 an entry and/or attribute, slapd compares the entry and/or attribute
668 to the {{EX:<what>}} selectors given in the configuration file.
669 For each entry, access control provided in the database which holds
670 the entry (or the first database if not held in any database) apply
671 first, followed by the global access directivies. Within this
672 priority, access directives are examined in the order in which they
673 appear in the config file. Slapd stops with the first {{EX:<what>}}
674 selector that matches the entry and/or attribute. The corresponding
675 access directive is the one slapd will use to evaluate access.
677 Next, slapd compares the entity requesting access to the {{EX:<who>}}
678 selectors within the access directive selected above in the order
679 in which they appear. It stops with the first {{EX:<who>}} selector
680 that matches the requester. This determines the access the entity
681 requesting access has to the entry and/or attribute.
683 Finally, slapd compares the access granted in the selected
684 {{EX:<access>}} clause to the access requested by the client. If
685 it allows greater or equal access, access is granted. Otherwise,
688 The order of evaluation of access directives makes their placement
689 in the configuration file important. If one access directive is
690 more specific than another in terms of the entries it selects, it
691 should appear first in the config file. Similarly, if one {{EX:<who>}}
692 selector is more specific than another it should come first in the
693 access directive. The access control examples given below should
694 help make this clear.
698 H3: Access Control Examples
700 The access control facility described above is quite powerful.
701 This section shows some examples of its use. First, some
704 > access to * by * read
706 This access directive grants read access to everyone.
713 This directive allows users to modify their own entries,
714 allows authenticate, and allows authenticated users to read.
715 Note that only the first {{EX:by <who>}} clause which matches applies.
716 Hence, the anonymous users are granted {{EX:auth}}, not {{EX:read}}.
717 The last clause could just as well have been "{{EX:by users read}}".
719 The following example shows the use of a regular expression
720 to select the entries by DN in two access directives where
721 ordering is significant.
723 > access to dn=".*,dc=example,dc=com"
725 > access to dn=".*,dc=com"
728 Read access is granted to entries under the {{EX:dc=com}}
729 subtree, except for those entries under the {{EX:dc=example,dc=com}}
730 subtree, to which search access is granted. No access is granted to
731 {{EX:dc=com}} as neither access directive matches this DN.
732 If the order of these access directives was reversed, the
733 trailing directive would never be reached, since all
734 {{EX:dc=example,dc=com}} entries are also {{EX:dc=com}} entries.
736 Also note that if no {{EX:access to}} directive matches or
737 no {{EX:by <who>}} clause, {{B:access is denied}}. That is, every
738 {{EX:access to}} directive ends with an implicit {{EX:by * none}}
739 clause and every access list ends with an implicit
740 {{EX:access to * by * none}} directive. Only if no access controls
741 are specified is the {{EX:defaultaccess}} granted.
743 The next example again shows the importance of ordering,
744 both of the access directives and the {{EX:by <who>}} clauses.
745 It also shows the use of an attribute selector to grant access
746 to a specific attribute and various {{EX:<who>}} selectors.
748 > access to dn="(.*,)?dc=example,dc=com" attr=homePhone
750 > by dn="(.*,)?dc=example,dc=com" search
751 > by domain=.*\.example\.com read
752 > access to dn="(.*,)?dc=example,dc=com"
754 > by dn=".*,dc=example,dc=com" search
757 This example applies to entries in the "{{EX:dc=example,dc=com}}"
758 subtree. To all attributes except {{EX:homePhone}}, the entry itself
759 can write them, other {{EX:example.com}} entries can search by them,
760 anybody else has no access ((implicit {{EX:by * none}}) excepting for
761 authentication/authorization (which is always done anonymously).
762 The {{EX:homePhone}} attribute is writable by the entry, searchable
763 by other {{EX:example.com}} entries, readable by clients connecting
764 from somewhere in the {{EX:example.com}} domain, and otherwise not
765 readable (implicit {{EX:by * none}}). All other access
766 is denied by the implicit {{EX:access to * by * none}}.
768 Sometimes it is useful to permit a particular DN to add or
769 remove itself from an attribute. For example, if you would like to
770 create a group and allow people to add and remove only
771 their own DN from the member attribute, you could accomplish
772 it with an access directive like this:
774 > access to attr=member,entry
775 > by dnattr=member selfwrite
777 The dnattr {{EX:<who>}} selector says that the access applies to
778 entries listed in the {{EX:member}} attribute. The {{EX:selfwrite}} access
779 selector says that such members can only add or delete their
780 own DN from the attribute, not other values. The addition of
781 the entry attribute is required because access to the entry is
782 required to access any of the entry's attributes.
785 For more details on how to use the {{EX:access}} directive,
786 consult the {{Advanced Access Control}} chapter.
790 H2: Configuration File Example
792 The following is an example configuration file, interspersed
793 with explanatory text. It defines two databases to handle
794 different parts of the {{TERM:X.500}} tree; both are {{TERM:LDBM}}
795 database instances. The line numbers shown are provided for
796 reference only and are not included in the actual file. First, the
797 global configuration section:
799 E: 1. # example config file - global configuration section
800 E: 2. include /usr/local/etc/schema/core.schema
801 E: 3. referral ldap://root.openldap.org
802 E: 4. access to * by * read
804 Line 1 is a comment. Line 2 includes another config file
805 which containing {{core}} schema definitions.
806 The {{EX:referral}} directive on line 3
807 means that queries not local to one of the databases defined
808 below will be referred to the LDAP server running on the
809 standard port (389) at the host {{EX:root.openldap.org}}.
811 Line 4 is a global access control. It applies to all
812 entries (after any applicable database-specific access
815 The next section of the configuration file defines an LDBM
816 backend that will handle queries for things in the
817 "dc=example,dc=com" portion of the tree. The
818 database is to be replicated to two slave slapds, one on
819 truelies, the other on judgmentday. Indexes are to be
820 maintained for several attributes, and the {{EX:userPassword}}
821 attribute is to be protected from unauthorized access.
823 E: 5. # ldbm definition for the example.com
825 E: 7. suffix "dc=example,dc=com"
826 E: 8. directory /usr/local/var/openldap
827 E: 9. rootdn "cn=Manager,dc=example,dc=com"
829 E: 11. # replication directives
830 E: 12. replogfile /usr/local/var/openldap/slapd.replog
831 E: 13. replica host=slave1.example.com:389
832 E: 14. binddn="cn=Replicator,dc=example,dc=com"
833 E: 15. bindmethod=simple credentials=secret
834 E: 16. replica host=slave2.example.com
835 E: 17. binddn="cn=Replicator,dc=example,dc=com"
836 E: 18. bindmethod=simple credentials=secret
837 E: 19. # indexed attribute definitions
838 E: 20. index uid pres,eq
839 E: 21. index cn,sn,uid pres,eq,approx,sub
840 E: 22. index objectClass eq
841 E: 23. # ldbm access control definitions
842 E: 24. access to attr=userPassword
844 E: 26. by anonymous auth
845 E: 27. by dn="cn=Admin,dc=example,dc=com" write
849 E: 31. by dn="cn=Admin,dc=example,dc=com" write
852 Line 5 is a comment. The start of the database definition is marked
853 by the database keyword on line 6. Line 7 specifies the DN suffix
854 for queries to pass to this database. Line 8 specifies the directory
855 in which the database files will live.
857 Lines 9 and 10 identify the database "super user" entry and associated
858 password. This entry is not subject to access control or size or
859 time limit restrictions.
861 Lines 11 through 18 are for replication. Line 11 specifies the
862 replication log file (where changes to the database are logged \-
863 this file is written by slapd and read by slurpd). Lines 12 through
864 14 specify the hostname and port for a replicated host, the DN to
865 bind as when performing updates, the bind method (simple) and the
866 credentials (password) for the binddn. Lines 15 through 18 specify
867 a second replication site. See the {{SECT:Replication with slurpd}}
868 chapter for more information on these directives.
870 Lines 20 through 22 indicate the indexes to maintain for various
873 Lines 24 through 32 specify access control for entries in the this
874 database. As this is the first database, the controls also apply
875 to entries not held in any database (such as the Root DSE). For
876 all applicable entries, the {{EX:userPassword}} attribute is writable
877 by the entry itself and by the "admin" entry. It may be used for
878 authentication/authorization purposes, but is otherwise not readable.
879 All other attributes are writable by the entry and the "admin"
880 entry, but may be read by authenticated users.
882 The next section of the example configuration file defines another
883 LDBM database. This one handles queries involving the
884 {{EX:dc=example,dc=net}} subtree. Note that without line 38, the
885 read access would be allowed due to the global access rule at line
888 E: 33. # ldbm definition for example.net
890 E: 35. suffix "dc=example,dc=net"
891 E: 36. directory /usr/local/var/ldbm-example-net
892 E: 37. rootdn "cn=Manager,dc=example,dc=com"
893 E: 38. access to * by users read