]> git.sur5r.net Git - openldap/blob - doc/guide/admin/slapdconfig.sdf
1f449bc781f1e7a5ce54396eea5a81d4cd097651
[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 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 {{I:slapd.conf}}(5) file, normally installed in the
10 {{EX:/usr/local/etc/openldap}} directory.
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 directive.
16
17
18
19 H2: Configuration File Format
20
21 The {{slapd.conf}}(5) file consists three types of configuration
22 information: global, backend specific, 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.
28
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
32 as follows:
33
34 E: # global configuration directives
35 E: <global config directives>
36 E:
37 E: # backend definition
38 E: backend <typeA>
39 E: <backend-specific directives>
40 E:
41 E: # first database definition & config directives
42 E: database <typeA>
43 E: <database-specific directives>
44 E:
45 E: # second database definition & config directives
46 E: database <typeB>
47 E: <database-specific directives>
48 E:
49 E: # second database definition & config directives
50 E: database <typeA>
51 E: <database-specific directives>
52 E:
53 E: # subsequent backend & database definitions & config directives
54 E: ...
55
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 "like this". If
59 an argument contains a double quote or a backslash character `\',
60 the character should be preceded by a backslash character `\'.
61
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 definition (attribute types
65 and object classes) are also provided in the
66 {{F: /usr/local/etc/openldap/schema}} directory.
67
68
69 H2: Configuration File Directives
70
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
76 its use.
77
78
79
80 H3: Global Directives
81
82 Directives described in this section apply to all backends,
83 unless specifically overridden in a backend definition. 
84 Arguments to directives should be replaced by actual text are
85 shown in brackets {{EX:<>}}.
86
87
88 H4: access to <what> [ by <who> <accesslevel> <control> ]+
89
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>). See Section 5.3 on
93 access control for more details and examples.
94
95
96 H4: attributetype <RFC2252 Attribute Type Description>
97
98 This directive defines an attribute type.
99
100 H4: defaultaccess { none | compare | search | read | write }
101
102 This directive specifies the default access to grant requesters
103 not matched by any other access line (see Section 5.3). Note
104 that an access level implies all lesser access levels (e.g.,
105 write access implies read, search and compare).
106
107 \Default:
108
109 E: defaultaccess read
110
111 H4: include <filename>
112
113 This directive specifies that slapd should read additional
114 configuration information from the given file before continuing
115 with the next line of the current file. The included file should
116 follow the normal slapd config file format.
117
118 Note: You should be careful when using this directive - there is
119 no small limit on the number of nested include directives, and no
120 loop detection is done.
121
122 H4: loglevel <integer>
123
124 This directive specifies the level at which debugging statements
125 and operation statistics should be syslogged (currently
126 logged to the syslogd(8) LOG_LOCAL4 facility). You must
127 have compiled slapd with  DLDAP_DEBUG for this to work
128 (except for the two stats levels, which are always enabled).
129 Log levels are additive. To display what numbers correspond
130 to what kind of debugging, invoke slapd with the  ? flag or
131 consult the table below. The possible values for <integer> are:
132
133 *1 trace function calls
134 *2 debug packet handling
135 *4 heavy trace debugging
136 *8 connection management
137 *16 print out packets sent and received
138 *32 search filter processing
139 *64 configuration file processing
140 *128 access control list processing
141 *256 stats log connections/operations/results
142 *512 stats log entries sent
143 *1024 print communication with shell backends
144 *2048 print entry parsing debugging
145
146 \Example:
147
148 E: loglevel 255
149
150 This will cause lots and lots of debugging information to be
151 syslogged.
152
153 \Default:
154
155 E: loglevel 256
156
157 H4: objectclass <RFC2252 Object Class Description>
158
159 This directive defines an object class.
160
161 H4: referral <url>
162
163 This directive specifies the referral to pass back when slapd
164 cannot find a local database to handle a request.
165
166 \Example:
167
168 E: referral ldap://root.openldap.org
169
170 This will refer non-local queries to the global root LDAP server
171 at the OpenLDAP Project. Smart LDAP clients can re-ask their
172 query at that server, but note that most of these clients are
173 only going to know how to handle simple LDAP URLs that
174 contain a host part and optionally a distinguished name part.
175
176 H4: schemacheck { on | off }
177
178 This directive turns schema checking on or off. If schema
179 checking is on, entries added or modified through LDAP operations
180 will be checked to ensure they obey the schema rules implied
181 by their object class(es) as defined by the corresponding objectclass
182 directive(s). If schema checking is off this check is not done.
183
184 \Default:
185
186 E: schemacheck on
187
188 H4: sizelimit <integer>
189
190 This directive specifies the maximum number of entries to return
191 from a search operation.
192
193 \Default:
194
195 E: sizelimit 500
196
197
198 H4: srvtab <filename>
199
200 This directive specifies the srvtab file in which slapd can find the
201 kerberos keys necessary for authenticating clients using
202 kerberos. This directive is only meaningful if you are using
203 kerberos authentication, which must be enabled at compile
204 time by including the appropriate definitions in the
205 {{EX: Make-common}} file.
206
207 \Default:
208
209 E: srvtab /etc/srvtab
210
211 H4: timelimit <integer>
212
213 This directive specifies the maximum number of seconds (in real
214 time) slapd will spend answering a search request. If a
215 request is not finished in this time, a result indicating an
216 exceeded timelimit will be returned.
217
218 \Default:
219
220 E: timelimit 3600
221
222
223 H3: General Backend Directives
224
225 H3: General Database Directives
226
227 Directives in this section only apply to the database in which
228 they are defined. They are supported by every type of database.
229
230 H4: database <databasetype>
231
232 This directive marks the beginning of a new database instance
233 definition. <databasetype> should be one of ldbm, shell, or
234 passwd, depending on which backend will serve the
235 database.
236
237 \Example:
238
239 E: database ldbm
240
241 This marks the beginning of a new LDBM backend database
242 instance definition.
243
244 H4: lastmod { on | off }
245
246 This directive controls whether slapd will automatically maintain
247 the modifiersName, modifyTimestamp, creatorsName, and
248 createTimestamp attributes for entries.
249
250 \Default:
251
252 E: lastmod on
253
254 H4: readonly { on | off }
255
256 This directive puts the database into "read-only" mode. Any
257 attempts to modify the database will return an "unwilling to
258 perform" error.
259
260 \Default:
261
262 E: readonly off
263
264 H4: replica
265
266 .{{EX:replica host=<hostname>[:<port>]}}
267 ..{{EX:"binddn=<DN>"}}
268 ..{{EX:bindmethod={ simple | kerberos }}}
269 ..{{EX:[credentials=<password>]}}
270 ..{{EX:[srvtab=<filename>]}}
271
272 This directive 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 directive 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 directive 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 directive 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 directive 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, dc=example, dc=com"
323
324 H4: rootkrbname <kerberosname>
325
326 This directive 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 directive 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 directive 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 directive 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 directive 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 "dc=example, dc=com"
358
359 Queries with a DN ending in "dc=example, dc=com"
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 directive 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 Directives
376
377 Directives 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 directive 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 directive 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 directive 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 directive specifies the directory where the LDBM files
408 containing the database and associated indexes live.
409
410 \Default:
411
412 E: directory /usr/local/var/openldap-ldbm
413
414
415 H4: index {<attrlist> | default} [pres,eq,approx,sub,none]
416
417 This directive 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 default pres,eq
424 E: index objectclass,uid
425 E: index cn,sn eq,sub,approx
426
427 The first line sets the default to indices to maintain to present
428 and equality.  The second line causes the default (pres,eq) set
429 of indices to be maintained for objectclass and uid.  The third
430 line causes equality, substring, and approximate filters to be
431 maintained for cn and sn attributes.
432
433 H4: mode <integer>
434
435 This directive specifies the file protection mode that newly
436 created database index files should have.
437
438 \Default:
439
440 E: mode 0600
441
442
443
444 H3: Shell Backend-Specific Directives
445
446 E: bind <pathname>
447
448 E: unbind <pathname>
449
450 E: search <pathname>
451
452 E: compare <pathname>
453
454 E: modify <pathname>
455
456 E: modrdn <pathname>
457
458 E: add <pathname>
459
460 E: delete <pathname>
461
462 E: abandon <pathname>
463
464 These directives specify the pathname of the command to
465 execute in response to the given LDAP operation. The
466 command given should understand and follow the input/output
467 conventions described in Appendix B.
468
469 \Example:
470
471 E: search /usr/local/bin/search.sh
472
473 Note that you need only supply those commands you want the
474 backend to handle. Operations for which a command is not
475 supplied will be refused with an "unwilling to perform" error.
476
477
478
479 H3: Password Backend-Specific Directives
480
481 Directives in this category only apply to the PASSWD backend
482 database. That is, they must follow a "database passwd" line
483 and come before any other "database" line.
484
485 H4: file <filename>
486
487 This directive specifies an alternate passwd file to use.
488
489 \Default:
490
491 E: file /etc/passwd
492
493
494
495 H3: Tcl Backend-Specific Directives
496
497 H4: scriptpath <pathname>
498
499 This is the full path to a file containing the tcl command(s) to handle
500 the LDAP operations.
501
502 H4: Proc specifiers
503
504 E: bind <proc>
505
506 E: unbind <proc>
507
508 E: search <proc>
509
510 E: compare <proc>
511
512 E: modify <proc>
513
514 E: modrdn <proc>
515
516 E: add <proc>
517
518 E: delete <proc>
519
520 E: abandon <proc>
521
522 These directives specify the name of the proc (function) in the tcl script
523 specified in 'scriptpath' to execute in response to the given LDAP
524 operation.
525
526 \Example:
527
528 E: search proc_search
529
530 Note that you need only supply those commands you want the
531 tcl backend to handle. Operations for which a command is not
532 supplied will be refused with an "unwilling to perform" error.
533
534 H4: tclrealm <name>
535
536 This is one of the biggest pluses of using the tcl backend.
537 The realm let's you group several databases to the same interpretor.
538 This basically means they share the same global variables and proc
539 space. So global variables, as well as all the procs are callable
540 between databases. If no tclrealm is specified, it is put into the
541 "default" realm.
542
543
544
545 H2: Access Control
546
547 Access to slapd entries and attributes is controlled by the
548 access configuration file directive. The general form of an
549 access line is:
550
551 E: <access directive> ::= access to <what>
552 E:      [ by <who> <access> <control> ]+
553 E: <what> ::= * | [ dn[.<target style>]=<regex> ] [ filter=<ldapfilter> ]
554 E:      [ attrs=<attrlist> ]
555 E: <target style> ::= regex | base | one | subtree | children
556 E: <attrlist> ::= <attr> | <attr> , <attrlist>
557 E: <attr> ::= <attrname> | entry | children
558 E: <who> ::= [ * | anonymous | users | self | dn[.<subject style>]=<regex> ]
559 E:      [ dnattr=<attrname> ]
560 E:      [ group[/<objectclass>[/<attrname>][.<basic style>]]=<regex> ]
561 E:      [ peername[.<basic style>]=<regex> ] [ sockname[.<basic style>]=<regex> ]
562 E:      [ domain[.<basic style>]=<regex> ] [ sockurl[.<basic style>]=<regex> ]
563 E:      [ set=<setspec> ]
564 E:      [ aci=<attrname> ]
565 E: <subject style> ::= regex | exact | base | one | subtree | children
566 E: <basic style> ::= regex | exact
567 E: <access> ::= [self]{<level>|<priv>}
568 E: <level> ::= none | auth | compare | search | read | write
569 E: <priv> ::= {=|+|-}{w|r|s|c|x}+
570 E: <control> ::= [ stop | continue | break ]
571
572 where the <what> part selects the entries and/or attributes to
573 which the access applies, the <who> part specifies which
574 entities are granted access, and the <access> part specifies
575 the access granted. Multiple <who> <access> <control> triplets are
576 supported, allowing many entities to be granted different
577 access to the same set of entries and attributes.
578
579
580 H3: What to control access to
581
582 The <what> part of an access specification determines the
583 entries and attributes to which the access control applies.
584 Entries can be selected in two ways: by a regular expression
585 matching the entry's distinguished name:
586
587 E: dn=<regular expression>
588
589 Note: The DN pattern specified should be "normalized",
590 meaning that there should be no extra spaces, and commas
591 should be used to separate components. An example
592 normalized DN is "cn=Babs Jensen,dc=example,dc=com".
593 An example of a non-normalized DN is
594 "cn=Babs Jensen; dc=example, dc=com".
595
596 Or, entries may be selected by a filter matching some
597 attribute(s) in the entry:
598
599 E: filter=<ldap filter>
600
601 where <ldap filter> is a string representation of an LDAP
602 search filter, as described in RFC 2254.
603
604 The special entry selector "*" is used to select any entry,
605 and is a convenient 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 "{{EX:entry}}". Note that giving access to an
615 attribute is not enough; access to the entry itself through the
616 {{EX: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=".*,dc=example,dc=com"
723 E:      by * search
724 E: access to dn=".*,dc=com"
725 E:      by * read
726
727 Read access is granted to entries under the {{EX:dc=com}}
728 subtree, except for those entries under the {{EX:dc=example,dc=com}} subtree,
729 to which search access is granted. If the
730 order of these access directives was reversed, the
731 trailing directive would never be reached, since all
732 {{EX:dc=example,dc=com}} entries are also {{EX:dc=com}} 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=".*, dc=example, dc=com" attr=homePhone
740 E:      by self write
741 E:      by dn=".*,dc=example,dc=com" search
742 E:      by domain=.*\.example\.com read
743 E:      by * compare
744 E:access to dn=".*,dc=example,dc=com"
745 E:      by self write
746 E:      by dn=".*,dc=example,dc=com" search
747 E:      by * none
748
749 This example applies to entries in the "dc=example, dc=com"
750 subtree. To all attributes except homePhone, the entry itself
751 can write them, other Example.com entries can search by them,
752 anybody else has no access. The homePhone attribute is
753 writable by the entry, searchable by other Example.com entries,
754 readable by clients connecting from somewhere in the
755 example.com 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 directives
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 directives. The format of an {{EX: objectclass}} line is:
788
789 E: objectclass <RFC2252 Object Class Description>
790
791 This directive defines the schema rules for the object class
792 given by {{EX: <name>}}. Schema rules consist of the attributes the
793 entry is required to have (given by the requires {{EX: <attrs>}}
794 clause) and those attributes that it may optionally have (given
795 by the allows {{EX: <attrs>}} clause). In both clauses, {{EX: <attrs>}} is a
796 comma-separated list of attribute names.
797
798 Note that object class inheritance (that is, defining one object
799 class in terms of another) is not supported directly. All of an
800 object class's required and allowed attributes must be listed
801 in the objectclass definition.
802
803 For example, to define an objectclass called myPerson, you
804 might include a definition like this:
805
806 E: objectclass myperson
807 E:      requires cn, sn, objectclass
808 E:      allows mail, phone, fax
809
810 To then enforce this rule (i.e., to make sure an entry with an
811 objectclass of myperson contains the cn, sn and objectclass
812 attributes, and that it contains no other attributes besides
813 mail, phone, and fax), turn on schema checking with a line like
814 this:
815
816 E: schemacheck on
817
818
819
820 H2: Configuration File Example
821
822
823
824 The following is an example configuration file, interspersed
825 with explanatory text. It defines two databases to handle
826 different parts of the X.500 tree; both are LDBM database
827 instances. The line numbers shown are provided for
828 reference only and are not included in the actual file. First, the
829 global configuration section:
830
831 E: 1. # example config file - global configuration section
832 E: 2. include /usr/local/etc/schema/core.schema
833 E: 3. referral ldap://root.openldap.org
834
835 Line 1 is a comment. Lines 2 include another config file
836 which containing {{core}} schema definitions.
837 The {{EX: referral}} directive on line 3
838 means that queries not local to one of the databases defined
839 below will be referred to the LDAP server running on the
840 standard port (389) at the host {{EX: root.openldap.org}}.
841
842 The next section of the configuration file defines an LDBM
843 backend that will handle queries for things in the
844 "dc=example,dc=com" portion of the tree. The
845 database is to be replicated to two slave slapds, one on
846 truelies, the other on judgmentday. Indexes are to be
847 maintained for several attributes, and the {{EX: userPassword}}
848 attribute is to be protected from unauthorized access.
849
850 E: 1. # ldbm definition for the U-M database
851 E: 2. database ldbm
852 E: 3. suffix "dc=example, dc=com"
853 E: 4. directory /usr/local/var/openldap
854 E: 6. rootdn "cn=Manager, dc=example, dc=com"
855 E: 7. rootpw secret
856 E: 8. replogfile /usr/local/var/openldap/slapd.replog
857 E: 9. replica host=slave1.example.com:389
858 E: 10. binddn="cn=Replicator, dc=example, dc=com"
859 E: 11. bindmethod=simple credentials=secret
860 E: 12.replica host=slave2.example.com
861 E: 13. binddn="cn=Replicator, dc=example, dc=com"
862 E: 14. bindmethod=kerberos
863 E: 15. srvtab=/etc/srvtab.slave2
864 E: 16.# ldbm indexed attribute definitions
865 E: 17.index cn,sn,uid pres,eq,approx,sub
866 E: 18.index objectclass pres,eq
867 E: 19.index default none
868 E: 20.# ldbm access control definitions
869 E: 21.access to attr=userPassword
870 E: 23. by self write
871 E: 22. by anonymous auth
872 E: 23. by dn="cn=Admin,dc=example,dc=com" write
873 E: 25. by * none
874 E: 26.access to *
875 E: 27. by self write
876 E: 28. by anonymous auth
877 E: 29. by dn="cn=Admin,dc=example,dc=com" write
878 E: 30. by * read
879
880 Line 1 is a comment. The start of the database definition is
881 marked by the database keyword on line 2. Line 3 specifies
882 the DN suffix for queries to pass to this database. Line 4
883 specifies the directory in which the database files will live
884
885 Lines 6 and 7 identify the database "super user" entry and
886 associated password. This entry is not subject to access
887 control or size or time limit restrictions.
888
889 Lines 8 through 15 are for replication. Line 8 specifies the
890 replication log file (where changes to the database are logged
891 \- this file is written by slapd and read by slurpd). Lines 9
892 through 11 specify the hostname and port for a replicated
893 host, the DN to bind as when performing updates, the bind
894 method (simple) and the credentials (password) for the
895 binddn. Lines 12 through 15 specify a second replication site,
896 using kerberos instead of simple authentication. See Section
897 10 on slurpd for more information on these directives.
898
899 Lines 16 through 19 indicate the indexes to maintain for
900 various attributes. The default is not to maintain any indexes
901 (line 19).
902
903 Lines 20 through 30 specify access control for entries in the
904 database. For all entries, the {{EX: userPassword}} attribute is
905 writable by the entry and the "admin" entry, may be used for
906 authentication/authorization purposes, but is otherwise not
907 readable.  All other attributes by writable by the entry and
908 the "admin" entry, may be used for authentication/authorization
909 purposes, but may be read by authenticated users.
910
911 The next section of the example configuration file defines
912 another LDBM database. This one handles queries involving
913 the {{EX:dc=example,dc=net}} subtree.
914
915 E: 1. # ldbm definition for Babs, Inc. database
916 E: 2. database ldbm
917 E: 3. suffix "dc=example, dc=net"
918 E: 4. directory /usr/local/var/ldbm-example-net
919 E: 5. rootdn "cn=Manager, dc=example, dc=net"
920