]> git.sur5r.net Git - openldap/blob - doc/guide/admin/slapdconfig.sdf
Revamp chapter 1
[openldap] / doc / guide / admin / slapdconfig.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4
5 H1: The {{I: slapd}} Configuration File
6
7 Once the software has been built and installed, you are ready to configure it
8 for use at your site. All slapd runtime configuration is accomplished through
9 the {{EX: slapd.conf}} file, installed in the {{EX: ETCDIR}}
10 directory you specified in the {{EX: Make-common}} file.
11
12 An alternate configuration file can be specified via a
13 command-line option to slapd or slurpd (see Sections 5 and 8,
14 respectively). This section describes the general format of the config file,
15 followed by a detailed description of each config file option.
16
17
18
19 H2: Configuration File Format
20
21 The {{EX: slapd.conf}} file consists of a series of global configuration options
22 that apply to slapd as a whole (including all backends), followed by
23 zero or more database backend definitions that contain information
24 specific to a backend instance.
25
26 Global options can be overridden in a backend (for options that
27 appear more than once, the last appearance in the slapd.conf file is
28 used). Blank lines and comment lines beginning with a `#' character
29 are ignored. If a line begins with white space, it is considered a
30 continuation of the previous line. The general format of slapd.conf is
31 as follows:
32
33 E: # comment - these options apply to every database
34 E: <global config options>
35 E: # first database definition & config options
36 E: database <backend 1 type>
37 E: <config options specific to backend 1>
38 E: # second database definition & config options
39 E: database <backend 2 type>
40 E: <config options specific to backend 2>
41 E: # subsequent database definitions & config options
42 E: ...
43
44 Configuration line arguments are separated by white space. If
45 an argument contains white space, the argument should be
46 enclosed in double quotes "like this". If an argument contains
47 a double quote or a backslash character `\', the character
48 should be preceded by a backslash character `\'.
49
50 The distribution contains an example configuration file that will
51 be installed in the {{EX: ETCDIR}} directory. Also provided are
52 {{EX: slapd.at.conf}}, which contains many commonly used attribute
53 definitions, and {{EX: slapd.oc.conf}}, which contains many commonly
54 used object class definitions. These files can be included from
55 the slapd configuration file (see below).
56
57
58
59 H2: Configuration File Options
60
61 This section separates the configuration file options into
62 global and backend-specific categories, describing each
63 option and its default value (if any), and giving an example of
64 its use.
65
66
67
68 H3: Global Options
69
70 Options described in this section apply to all backends,
71 unless specifically overridden in a backend definition. Option
72 arguments that should be replaced by actual text are shown
73 in brackets <>.
74
75
76 H4: access to <what> [ by <who> <accesslevel> <control> ]+
77
78 This option grants access (specified by <accesslevel>) to a
79 set of entries and/or attributes (specified by <what>) by one or
80 more requesters (specified by <who>). See Section 5.3 on
81 access control for more details and examples.
82
83
84 H4: attribute <name> [<name2>] { bin | ces | cis | tel | dn }
85
86 This option associates a syntax with an attribute name. By
87 default, an attribute is assumed to have syntax cis. An
88 optional alternate name can be given for an attribute. The
89 possible syntaxes and their meanings are
90
91 * {{EX: bin}} binary
92 * {{EX: ces}} case exact string (case must match during comparisons)
93 * {{EX: cis}} case ignore string (case is ignored during comparisons)
94 * {{EX: tel}} telephone number string (like cis but blanks and dashes ` '
95 are ignored during comparisons)
96 * {{EX: dn}} distinguished name
97
98
99 H4: defaultaccess { none | compare | search | read | write }
100
101 This option specifies the default access to grant requesters
102 not matched by any other access line (see Section 5.3). Note
103 that an access level implies all lesser access levels (e.g.,
104 write access implies read, search and compare).
105
106 \Default:
107
108 E: defaultaccess read
109
110 H4: include <filename>
111
112 This option specifies that slapd should read additional
113 configuration information from the given file before continuing
114 with the next line of the current file. The included file should
115 follow the normal slapd config file format.
116
117 Note: You should be careful when using this option - there is
118 no small limit on the number of nested include options, and no
119 loop detection is done.
120
121 H4: loglevel <integer>
122
123 This option specifies the level at which debugging statements
124 and operation statistics should be syslogged (currently
125 logged to the syslogd(8) LOG_LOCAL4 facility). You must
126 have compiled slapd with  DLDAP_DEBUG for this to work
127 (except for the two stats levels, which are always enabled).
128 Log levels are additive. To display what numbers correspond
129 to what kind of debugging, invoke slapd with the  ? flag or
130 consult the table below. The possible values for <integer> are:
131
132 *1 trace function calls
133 *2 debug packet handling
134 *4 heavy trace debugging
135 *8 connection management
136 *16 print out packets sent and received
137 *32 search filter processing
138 *64 configuration file processing
139 *128 access control list processing
140 *256 stats log connections/operations/results
141 *512 stats log entries sent
142 *1024 print communication with shell backends
143 *2048 print entry parsing debugging
144
145 \Example:
146
147 E: loglevel 255
148
149 This will cause lots and lots of debugging information to be
150 syslogged.
151
152 \Default:
153
154 E: loglevel 256
155
156 H4: objectclass <name> [ requires <attrs> ] [ allows <attrs> ]
157
158 This option defines the schema rules for the given object
159 class. Used in conjunction with the schemacheck option. See
160 Section 5.4 for more details.
161
162 H4: referral <url>
163
164 This option specifies the referral to pass back when slapd
165 cannot find a local database to handle a request.
166
167 \Example:
168
169 E: referral ldap://ldap.openldap.org
170
171 This will refer non-local queries to the LDAP server at the
172 OpenLDAP Project. Smart LDAP clients can re-ask their
173 query at that server, but note that most of these clients are
174 only going to know how to handle simple LDAP URLs that
175 contain a host part and optionally a distinguished name part.
176
177 H4: schemacheck { on | off }
178
179 This option turns schema checking on or off. If schema
180 checking is on, entries added or modified through LDAP operations
181 will be checked to ensure they obey the schema rules implied
182 by their object class(es) as defined by the corresponding objectclass
183 option(s). If schema checking is off this check is not done.
184
185 \Default:
186
187 E: schemacheck on
188
189 H4: sizelimit <integer>
190
191 This option specifies the maximum number of entries to return
192 from a search operation.
193
194 \Default:
195
196 E: sizelimit 500
197
198
199 H4: srvtab <filename>
200
201 This option specifies the srvtab file in which slapd can find the
202 kerberos keys necessary for authenticating clients using
203 kerberos. This option is only meaningful if you are using
204 kerberos authentication, which must be enabled at compile
205 time by including the appropriate definitions in the
206 {{EX: Make-common}} file.
207
208 \Default:
209
210 E: srvtab /etc/srvtab
211
212 H4: timelimit <integer>
213
214 This option specifies the maximum number of seconds (in real
215 time) slapd will spend answering a search request. If a
216 request is not finished in this time, a result indicating an
217 exceeded timelimit will be returned.
218
219 \Default:
220
221 E: timelimit 3600
222
223
224
225 H3: General Backend Options
226
227 Options in this section only apply to the backend in which
228 they are defined. They are supported by every type of
229 backend.
230
231 H4: database <databasetype>
232
233 This option marks the beginning of a new database instance
234 definition. <databasetype> should be one of ldbm, shell, or
235 passwd, depending on which backend will serve the
236 database.
237
238 \Example:
239
240 E: database ldbm
241
242 This marks the beginning of a new LDBM backend database
243 instance definition.
244
245 H4: lastmod { on | off }
246
247 This option controls whether slapd will automatically maintain
248 the modifiersName, modifyTimestamp, creatorsName, and
249 createTimestamp attributes for entries.
250
251 \Default:
252
253 E: lastmod off
254
255 H4: readonly { on | off }
256
257 This option puts the database into "read-only" mode. Any
258 attempts to modify the database will return an "unwilling to
259 perform" error.
260
261 \Default:
262
263 E: readonly off
264
265 H4: replica
266 E: replica host=<hostname>[:<port>]
267 E: "binddn=<DN>"
268 E: bindmethod={ simple | kerberos }
269 E: \[credentials=<password>]
270 E: \[srvtab=<filename>]
271
272 This option specifies a replication site for this database. The
273 {{EX: host=}} parameter specifies a host and optionally a port where
274 the slave slapd instance can be found. Either a domain name
275 or IP address may be used for <hostname>. If <port> is not
276 given, the standard LDAP port number (389) is used.
277
278 The {{EX: binddn=}} parameter gives the DN to bind as for updates to
279 the slave slapd. It should be a DN which has read/write
280 access to the slave slapd's database, typically given as a
281 "rootdn" in the slave's config file. It must also match the
282 updatedn option in the slave slapd's config file. Since DNs are
283 likely to contain embedded spaces, the entire "{{EX: binddn=<DN>}}"
284 string should be enclosed in quotes.
285
286 {{EX: bindmethod}} is either simple or kerberos, depending on
287 whether simple password-based authentication or kerberos
288 authentication is to be used when connecting to the slave
289 slapd. Simple authentication requires a valid password be
290 given. Kerberos authentication requires a valid srvtab file.
291
292 The {{EX: credentials=}} parameter, which is only required if using
293 simple authentication, gives the password for binddn on the
294 slave slapd.
295
296 The {{EX: srvtab=}} parameter, which is only required if using
297 kerberos, specifies the filename which holds the kerberos key
298 for the slave slapd. If omitted, {{EX: /etc/srvtab}} is used.
299
300 See Section 10 for more details on replication.
301
302 H4: replogfile <filename>
303
304 This option specifies the name of the replication log file to
305 which slapd will log changes. The replication log is typically
306 written by slapd and read by slurpd. Normally, this option is
307 only used if slurpd is being used to replicate the database.
308 However, you can also use it to generate a transaction log, if
309 slurpd is not running. In this case, you will need to periodically
310 truncate the file, since it will grow indefinitely otherwise.
311
312 See Section 10 for more details on replication.
313
314 H4: rootdn <dn>
315
316 This option specifies the DN of an entry that is not subject to
317 access control or administrative limit restrictions for
318 operations on this database.
319
320 \Example:
321
322 E: rootdn "cn=Manager, o=OpenLDAP Project, c=US"
323
324 H4: rootkrbname <kerberosname>
325
326 This option specifies a kerberos name for the DN given above
327 that will always work, regardless of whether an entry with the
328 given DN exists or has a {{EX: krbName}} attribute. This option is
329 useful when creating a database and also when using slurpd
330 to provide replication service (see Section 10).
331
332 \Example:
333
334 E: rootkrbname admin@openldap.org
335
336 H4: rootpw <password>
337
338 This option specifies a password for the DN given above that
339 will always work, regardless of whether an entry with the given
340 DN exists or has a password. This option is useful when
341 creating a database and also when using slurpd to provide
342 replication service (see Section 10).
343
344 \Example:
345
346 E: rootpw secret
347
348 H4: suffix <dn suffix>
349
350 This option specifies the DN suffix of queries that will be
351 passed to this backend database. Multiple suffix lines can be
352 given, and at least one is required for each database
353 definition.
354
355 \Example:
356
357 E: suffix "o=OpenLDAP Project, c=US"
358
359 Queries with a DN ending in "o=OpenLDAP Project, c=US"
360 will be passed to this backend.
361
362 Note: when the backend to pass a query to is selected, slapd
363 looks at the suffix line(s) in each database definition in the
364 order they appear in the file. Thus, if one database suffix is a
365 prefix of another, it must appear after it in the config file.
366
367 H4: updatedn <dn>
368
369 This option is only applicable in a slave slapd. It specifies the
370 DN allowed to make changes to the replica (typically, this is
371 the DN slurpd binds as when making changes to the replica).
372
373
374
375 H3: LDBM Backend-Specific Options
376
377 Options in this category only apply to the LDBM backend
378 database. That is, they must follow a "database ldbm" line and
379 come before any other "database" line.
380
381 H4: cachesize <integer>
382
383 This option specifies the size in entries of the in-memory
384 cache maintained by the LDBM backend database instance.
385
386 \Default:
387
388 E: cachesize 1000
389
390
391 H4: dbcachesize <integer>
392
393 This option specifies the size in bytes of the in-memory cache
394 associated with each open index file. If not supported by the
395 underlying database method, this option is ignored without
396 comment. Increasing this number uses more memory but can
397 cause a dramatic performance increase, especially during
398 modifies or when building indexes.
399
400 \Default:
401
402 E: dbcachesize 100000
403
404
405 H4: directory <directory>
406
407 This option specifies the directory where the LDBM files
408 containing the database and associated indexes live.
409
410 \Default:
411
412 E: directory /usr/tmp
413
414
415 H4: index {<attrlist> | default} [pres,eq,approx,sub,none]
416
417 This option specifies the indexes to maintain for the given
418 attribute. If only an <attrlist> is given, all possible indexes are
419 maintained.
420
421 \Example:
422
423 E: index cn
424
425 E: index sn,uid eq,sub,approx
426
427 E: index default none
428
429 This example causes all indexes to be maintained for the cn
430 attribute; equality, substring, and approximate indexes for the
431 sn and uid attributes; and no indexes for all other attributes.
432
433
434 H4: mode <integer>
435
436 This option specifies the file protection mode that newly
437 created database index files should have.
438
439 \Default:
440
441 E: mode 0600
442
443
444
445 H3: Shell Backend-Specific Options
446
447 E: bind <pathname>
448
449 E: unbind <pathname>
450
451 E: search <pathname>
452
453 E: compare <pathname>
454
455 E: modify <pathname>
456
457 E: modrdn <pathname>
458
459 E: add <pathname>
460
461 E: delete <pathname>
462
463 E: abandon <pathname>
464
465 These options specify the pathname of the command to
466 execute in response to the given LDAP operation. The
467 command given should understand and follow the input/output
468 conventions described in Appendix B.
469
470 \Example:
471
472 E: search /usr/local/bin/search.sh
473
474 Note that you need only supply those commands you want the
475 backend to handle. Operations for which a command is not
476 supplied will be refused with an "unwilling to perform" error.
477
478
479
480 H3: Password Backend-Specific Options
481
482 Options in this category only apply to the PASSWD backend
483 database. That is, they must follow a "database passwd" line
484 and come before any other "database" line.
485
486 H4: file <filename>
487
488 This option specifies an alternate passwd file to use.
489
490 \Default:
491
492 E: file /etc/passwd
493
494
495
496 H3: Tcl Backend-Specific Options
497
498 H4: scriptpath <pathname>
499
500 This is the full path to a file containing the tcl command(s) to handle
501 the LDAP operations.
502
503 H4: Proc specifiers
504
505 E: bind <proc>
506
507 E: unbind <proc>
508
509 E: search <proc>
510
511 E: compare <proc>
512
513 E: modify <proc>
514
515 E: modrdn <proc>
516
517 E: add <proc>
518
519 E: delete <proc>
520
521 E: abandon <proc>
522
523 These options specify the name of the proc (function) in the tcl script
524 specified in 'scriptpath' to execute in response to the given LDAP
525 operation.
526
527 \Example:
528
529 E: search proc_search
530
531 Note that you need only supply those commands you want the
532 tcl backend to handle. Operations for which a command is not
533 supplied will be refused with an "unwilling to perform" error.
534
535 H4: tclrealm <name>
536
537 This is one of the biggest pluses of using the tcl backend.
538 The realm let's you group several databases to the same interpretor.
539 This basically means they share the same global variables and proc
540 space. So global variables, as well as all the procs are callable
541 between databases. If no tclrealm is specified, it is put into the
542 "default" realm.
543
544
545
546 H2: Access Control
547
548 Access to slapd entries and attributes is controlled by the
549 access configuration file directive. The general form of an
550 access line is:
551
552 E: <access directive> ::= access to <what>
553 E:      [ by <who> <access> <control> ]+
554 E: <what> ::= * | [ dn[.<target style>]=<regex> ] [ filter=<ldapfilter> ]
555 E:      [ attrs=<attrlist> ]
556 E: <target style> ::= regex | base | one | subtree | children
557 E: <attrlist> ::= <attr> | <attr> , <attrlist>
558 E: <attr> ::= <attrname> | entry | children
559 E: <who> ::= [ * | anonymous | users | self | dn[.<subject style>]=<regex> ]
560 E:      [ dnattr=<attrname> ]
561 E:      [ group[/<objectclass>[/<attrname>][.<basic style>]]=<regex> ]
562 E:      [ peername[.<basic style>]=<regex> ] [ sockname[.<basic style>]=<regex> ]
563 E:      [ domain[.<basic style>]=<regex> ] [ sockurl[.<basic style>]=<regex> ]
564 E:      [ set=<setspec> ]
565 E:      [ aci=<attrname> ]
566 E: <subject style> ::= regex | exact | base | one | subtree | children
567 E: <basic style> ::= regex | exact
568 E: <access> ::= [self]{<level>|<priv>}
569 E: <level> ::= none | auth | compare | search | read | write
570 E: <priv> ::= {=|+|-}{w|r|s|c|x}+
571 E: <control> ::= [ stop | continue | break ]
572
573 where the <what> part selects the entries and/or attributes to
574 which the access applies, the <who> part specifies which
575 entities are granted access, and the <access> part specifies
576 the access granted. Multiple <who> <access> <control> triplets are
577 supported, allowing many entities to be granted different
578 access to the same set of entries and attributes.
579
580
581 H3: What to control access to
582
583 The <what> part of an access specification determines the
584 entries and attributes to which the access control applies.
585 Entries can be selected in two ways: by a regular expression
586 matching the entry's distinguished name:
587
588 E: dn=<regular expression>
589
590 Note: The DN pattern specified should be "normalized",
591 meaning that there should be no extra spaces, and commas
592 should be used to separate components. An example
593 normalized DN is "cn=Babs Jensen,o=OpenLDAP Project,c=US".
594 An example of a non-normalized DN is
595 "cn=Babs Jensen; o=OpenLDAP Project, c=US".
596
597 Or, entries may be selected by a filter matching some
598 attribute(s) in the entry:
599
600 E: filter=<ldap filter>
601
602 where <ldap filter> is a string representation of an LDAP
603 search filter, as described in RFC 1588. The special entry
604 selector "*" is used to select any entry, and is a convenient
605 shorthand for the equivalent "dn=.*" selector.
606
607 Attributes within an entry are selected by including a
608 comma-separated list of attribute names in the <what>
609 selector:
610
611 E: attrs=<attribute list>
612
613 Access to the entry itself must be granted or denied using the
614 special attribute name "entry". Note that giving access to an
615 attribute is not enough; access to the entry itself through the
616 "entry" attribute is also required. The complete examples at
617 the end of this section should help clear things up.
618
619
620
621 H2: Who to grant access to
622
623 The <who> part identifies the entity or entities being granted
624 access. Note that access is granted to "entities" not "entries."
625 Entities can be specified by the special "*" identifier, matching
626 any entry, the keyword "self" matching the entry protected by
627 the access, or by a regular expression matching an entry's
628 distinguished name:
629
630 E: dn=<regular expression>
631
632 Note:  The DN pattern specified should be "normalized",
633 meaning that there should be no extra spaces, and commas
634 should be used to separate components.
635
636 Or entities can be specified by a regular expression matching
637 the client's IP address or domain name:
638
639 E: addr=<regular expression>
640 E: domain=<regular expression>
641
642 or by an entry listed in a DN-valued attribute in the entry to
643 which the access applies:
644
645 E: dnattr=<dn-valued attribute name>
646
647 The dnattr specification is used to give access to an entry
648 whose DN is listed in an attribute of the entry (e.g., give
649 access to a group entry to whoever is listed as the owner of
650 the group entry).
651
652
653
654 H3: The access to grant
655
656
657 The kind of <access> granted can be one of the following:
658
659 E: none | compare | search | read | write
660
661 Note that each level implies all lower levels of access. So, for
662 example, granting someone write access to an entry also
663 grants them read, search, and compare access.
664
665
666
667 H3: Access Control Evaluation
668
669 When evaluating whether some requester should be given
670 access to an entry and/or attribute, slapd compares the entry
671 and/or attribute to the {{EX: <what>}} selectors given in the
672 configuration file. Access directives local to the current
673 database are examined first, followed by global access
674 directives. Within this priority, access directives are
675 examined in the order in which they appear in the config file.
676 Slapd stops with the first {{EX: <what>}} selector that matches the
677 entry and/or attribute. The corresponding access directive is
678 the one slapd will use to evaluate access.
679
680 Next, slapd compares the entity requesting access to the
681 {{EX: <who>}} selectors within the access directive selected above,
682 in the order in which they appear. It stops with the first {{EX: <who>}}
683 selector that matches the requester. This determines the
684 access the entity requesting access has to the entry and/or
685 attribute.
686
687 Finally, slapd compares the access granted in the selected
688 {{EX: <access>}} clause to the access requested by the client. If it
689 allows greater or equal access, access is granted. Otherwise,
690 access is denied.
691
692 The order of evaluation of access directives makes their
693 placement in the configuration file important. If one access
694 directive is more specific than another in terms of the entries
695 it selects, it should appear first in the config file. Similarly, if
696 one {{EX: <who>}} selector is more specific than another it should
697 come first in the access directive. The access control
698 examples given below should help make this clear.
699
700
701
702 H3: Access Control Examples
703
704
705
706 The access control facility described above is quite powerful.
707 This section shows some examples of its use. First, some
708 simple examples:
709
710 E: access to * by * read
711
712 This access directive grants read access to everyone. If it
713 appears alone it is the same as the following defaultaccess
714 line.
715
716 E: defaultaccess read
717
718 The following example shows the use of a regular expression
719 to select the entries by DN in two access directives where
720 ordering is significant.
721
722 E: access to dn=".*, o=OpenLDAP Project, c=US"
723 E:      by * search
724 E: access to dn=".*, c=US"
725 E:      by * read
726
727 Read access is granted to entries under the c=US subtree,
728 except for those entries under the "o=OpenLDAP Project,
729 c=US" subtree, to which search access is granted. If the
730 order of these access directives was reversed, the
731 OpenLDAP-specific directive would never be matched, since all
732 OpenLDAP entries are also c=US entries.
733
734 The next example again shows the importance of ordering,
735 both of the access directives and the "by" clauses. It also
736 shows the use of an attribute selector to grant access to a
737 specific attribute and various <who> selectors.
738
739 E:access to dn=".*, o=OpenLDAP Project, c=US" attr=homePhone
740 E:      by self write
741 E:      by dn=".*, o=OpenLDAP Project, c=US" search
742 E:      by domain=.*\.openldap\.org read
743 E:      by * compare
744 E:access to dn=".*, o=OpenLDAP Project, c=US"
745 E:      by self write
746 E:      by dn=".*, o=OpenLDAP Project, c=US" search
747 E:      by * none
748
749 This example applies to entries in the "o=OpenLDAP Project, c=US"
750 subtree. To all attributes except homePhone, the entry itself
751 can write them, other OpenLDAP entries can search by them,
752 anybody else has no access. The homePhone attribute is
753 writable by the entry, searchable by other OpenLDAP entries,
754 readable by clients connecting from somewhere in the
755 OpenLDAP.org domain, and comparable by everybody else.
756
757 Sometimes it is useful to permit a particular DN to add or
758 remove itself from an attribute. For example, if you would like to
759 create a group and allow people too add and remove only
760 their own DN from the member attribute, you could accomplish
761 it with an access directive like this:
762
763 E: access to attr=member,entry
764 E:      by dnattr=member selfwrite
765
766 The dnattr {{EX: <who>}} selector says that the access applies to
767 entries listed in the member attribute. The selfwrite access
768 selector says that such members can only add or delete their
769 own DN from the attribute, not other values. The addition of
770 the entry attribute is required because access to the entry is
771 required to access any of the entry's attributes.
772
773 Note that the attr=member construct in the {{EX: <what>}} clause is a
774 shorthand for the clause "dn=* attr=member" (i.e., it matches
775 the member attribute in all entries).
776
777
778
779 H2: Schema Enforcement
780
781
782
783 The {{EX: objectclass}} and schemacheck configuration file options
784 can be used to enforce schema rules on entries in the
785 directory. The schema rules are defined by one or more
786 objectclass lines, and enforcement is turned on or off via the
787 schemacheck option. The format of an {{EX: objectclass}} line is:
788
789 E: objectclass <name>
790 E:      [ requires <attrs> ]
791 E:      [ allows <attrs> ]
792
793 This option defines the schema rules for the object class
794 given by {{EX: <name>}}. Schema rules consist of the attributes the
795 entry is required to have (given by the requires {{EX: <attrs>}}
796 clause) and those attributes that it may optionally have (given
797 by the allows {{EX: <attrs>}} clause). In both clauses, {{EX: <attrs>}} is a
798 comma-separated list of attribute names.
799
800 Note that object class inheritance (that is, defining one object
801 class in terms of another) is not supported directly. All of an
802 object class's required and allowed attributes must be listed
803 in the objectclass definition.
804
805 For example, to define an objectclass called myPerson, you
806 might include a definition like this:
807
808 E: objectclass myperson
809 E:      requires cn, sn, objectclass
810 E:      allows mail, phone, fax
811
812 To then enforce this rule (i.e., to make sure an entry with an
813 objectclass of myperson contains the cn, sn and objectclass
814 attributes, and that it contains no other attributes besides
815 mail, phone, and fax), turn on schema checking with a line like
816 this:
817
818 E: schemacheck on
819
820
821
822 H2: Configuration File Example
823
824
825
826 The following is an example configuration file, interspersed
827 with explanatory text. It defines two databases to handle
828 different parts of the X.500 tree; both are LDBM database
829 instances. The line numbers shown are provided for
830 reference only and are not included in the actual file. First, the
831 global configuration section:
832
833 E: 1. # example config file - global configuration section
834 E: 2. include /usr/local/etc/slapd.at.conf
835 E: 3. include /usr/local/etc/slapd.oc.conf
836 E: 4. schemacheck on
837 E: 5. referral ldap://ldap.openldap.org
838
839 Line 1 is a comment. Lines 2 and 3 include other config files
840 containing attribute and object class definitions, respectively.
841 Line 4 turns on schema checking. The {{EX: referral}} option on line 5
842 means that queries not local to one of the databases defined
843 below will be referred to the LDAP server running on the
844 standard port (389) at the host {{EX: ldap.openldap.org}}.
845
846 The next section of the configuration file defines an LDBM
847 backend that will handle queries for things in the
848 "o=OpenLDAP Project, c=US" portion of the tree. The
849 database is to be replicated to two slave slapds, one on
850 truelies, the other on judgmentday. Indexes are to be
851 maintained for several attributes, and the {{EX: userPassword}}
852 attribute is to be protected from unauthorized access.
853
854 E: 1. # ldbm definition for the U-M database
855 E: 2. database ldbm
856 E: 3. suffix "o=OpenLDAP Project, c=US"
857 E: 4. directory /usr/local/var/openldap
858 E: 6. rootdn "cn=Manager, o=OpenLDAP Project, c=US"
859 E: 7. rootpw secret
860 E: 8. replogfile /usr/local/var/openldap/slapd.replog
861 E: 9. replica host=slave1.openldap.org:389
862 E: 10. binddn="cn=Replicator, o=OpenLDAP Project, c=US"
863 E: 11. bindmethod=simple credentials=secret
864 E: 12.replica host=slave2.openldap.org
865 E: 13. binddn="cn=Replicator, o=OpenLDAP Project, c=US"
866 E: 14. bindmethod=kerberos
867 E: 15. srvtab=/etc/srvtab.slave2
868 E: 16.# ldbm indexed attribute definitions
869 E: 17.index cn,sn,uid pres,eq,approx,sub
870 E: 18.index objectclass pres,eq
871 E: 19.index default none
872 E: 20.# ldbm access control definitions
873 E: 21.defaultaccess read
874 E: 22.access to attr=userpassword
875 E: 23. by self write
876 E: 24. by dn="cn=Admin, o=OpenLDAP Project, c=US" write
877 E: 25. by * compare
878
879 Line 1 is a comment. The start of the database definition is
880 marked by the database keyword on line 2. Line 3 specifies
881 the DN suffix for queries to pass to this database. Line 4
882 specifies the directory in which the database files will live
883
884 Lines 6 and 7 identify the database "super user" entry and
885 associated password. This entry is not subject to access
886 control or size or time limit restrictions.
887
888 Lines 8 through 15 are for replication. Line 8 specifies the
889 replication log file (where changes to the database are logged
890 \- this file is written by slapd and read by slurpd). Lines 9
891 through 11 specify the hostname and port for a replicated
892 host, the DN to bind as when performing updates, the bind
893 method (simple) and the credentials (password) for the
894 binddn. Lines 12 through 15 specify a second replication site,
895 using kerberos instead of simple authentication. See Section
896 10 on slurpd for more information on these options.
897
898 Lines 16 through 19 indicate the indexes to maintain for
899 various attributes. The default is not to maintain any indexes
900 (line 19).
901
902 Lines 20 through 25 specify access control for entries in the
903 database. For all entries, the {{EX: userPassword}} attribute is
904 writable by the entry and the "admin" entry, comparable by
905 everyone else. All other attributes allow read access by
906 default (line 21). Note that the special "entry" attribute is not
907 required in the access directive beginning on line 22. This is
908 because the default access is read.
909
910 The next section of the example configuration file defines
911 another LDBM database. This one handles queries involving
912 the "o="Babs, Inc.", c=US" subtree.
913
914 E: 1. # ldbm definition for Babs, Inc. database
915 E: 2. database ldbm
916 E: 3. suffix "o=\"Babs, Inc.\", c=US"
917 E: 4. directory /usr/local/ldbm-babs
918 E: 5. rootdn "cn=Babs, o=\"Babs, Inc.\", c=US"
919 E: 6. index default
920
921 Note the use of `\' to escape the quotes necessary in the
922 distinguished names given on lines 3 and 5. By default, all
923 indexes are maintained for every attribute in an entry.
924