]> git.sur5r.net Git - openldap/blob - doc/guide/admin/intro.sdf
Add link to SDF tools at CPAN.
[openldap] / doc / guide / admin / intro.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4 H1: Introduction to OpenLDAP Directory Services
5
6 This document describes how to build, configure, and operate OpenLDAP
7 software to provide directory services.  This includes details on
8 how to configure and run the stand-alone {{TERM:LDAP}} daemon,
9 {{slapd}}(8) and the stand-alone LDAP update replication daemon,
10 {{slurpd}}(8). It is intended for newcomers and experienced
11 administrators alike.  This section provides a basic introduction
12 to directory services and, in particular, the directory services
13 provided by {{slapd}}(8).
14
15
16 H2: What is a directory service?
17
18 A directory is a specialized database optimized for reading, browsing
19 and searching.  Directories tend to contain descriptive, attribute-based
20 information and support sophisticated filtering capabilities.
21 Directories generally do not support complicated transaction or
22 roll-back schemes found in database management systems designed
23 for handling high-volume complex updates.  Directory updates are
24 typically simple all-or-nothing changes, if they are allowed at
25 all.  Directories are tuned to give quick response to high-volume
26 lookup or search operations. They may have the ability to replicate
27 information widely in order to increase availability and reliability,
28 while reducing response time.  When directory information is
29 replicated, temporary inconsistencies between the replicas may be
30 okay, as long as they get in sync eventually.
31
32 There are many different ways to provide a directory service.
33 Different methods allow different kinds of information to be stored
34 in the directory, place different requirements on how that information
35 can be referenced, queried and updated, how it is protected from
36 unauthorized access, etc.  Some directory services are {{local}},
37 providing service to a restricted context (e.g., the finger service
38 on a single machine). Other services are global, providing service
39 to a much broader context (e.g., the entire Internet).  Global
40 services are usually {{distributed}}, meaning that the data they
41 contain is spread across many machines, all of which cooperate to
42 provide the directory service. Typically a global service defines
43 a uniform {{namespace}} which gives the same view of the data no
44 matter where you are in relation to the data itself.  The Internet
45 {{TERM[expand]DNS}} (DNS) is an example of a globally distributed
46 directory service.
47
48
49 H2: What is LDAP?
50
51 {{TERM:LDAP}} stands for {{TERM[expand]LDAP}}.  As the name suggests,
52 it is a lightweight protocol for accessing directory services,
53 specifically {{TERM:X.500}}-based directory services.  LDAP runs
54 over {{TERM:TCP}}/{{TERM:IP}} or other connection oriented transfer
55 services.  The nitty-gritty details of LDAP are defined in
56 {{REF:RFC2251}} "The Lightweight Directory Access Protocol (v3)."
57 This section gives an overview of LDAP from a user's perspective.
58
59 {{What kind of information can be stored in the directory?}} The
60 LDAP information model is based on {{entries}}. An entry is a
61 collection of attributes that has a globally-unique {{TERM[expand]DN}}
62 (DN).  The DN is used to refer to the entry unambiguously. Each of
63 the entry's attributes has a {{type}} and one or more {{values}}.
64 The types are typically mnemonic strings, like "{{EX:cn}}" for
65 common name, or "{{EX:mail}}" for email address. The syntax of
66 values depend on the attribute type.  For example, a {{EX:cn}}
67 attribute might contain the value {{EX:Babs Jensen}}.  A {{EX:mail}}
68 attribute might contain the value "{{EX:babs@example.com}}". A
69 {{EX:jpegPhoto}} attribute would contain a photograph in the JPEG
70 (binary) format.
71
72 {{How is the information arranged?}} In LDAP, directory entries
73 are arranged in a hierarchical tree-like structure.  Traditionally,
74 this structure reflected the geographic and/or organizational
75 boundaries.  Entries representing countries appear at the top of
76 the tree. Below them are entries representing states and national
77 organizations. Below them might be entries representing organizational
78 units, people, printers, documents, or just about anything else
79 you can think of.  Figure 1.1 shows an example LDAP directory tree
80 using traditional naming.
81
82 !import "intro_tree.gif"; align="center"; \
83         title="LDAP directory tree (traditional naming)"
84 FT[align="Center"] Figure 1.1: LDAP directory tree (traditional naming)
85
86 The tree may also be arranged based upon Internet domain names.
87 This naming approach is becoming increasing popular as it allows
88 for directory services to be located using the {{DNS}}.
89 Figure 1.2 shows an example LDAP directory tree using domain-based
90 naming.
91
92 !import "intro_dctree.gif"; align="center"; \
93         title="LDAP directory tree (Internet naming)"
94 FT[align="Center"] Figure 1.2: LDAP directory tree (Internet naming)
95
96 In addition, LDAP allows you to control which attributes are required
97 and allowed in an entry through the use of a special attribute
98 called {{EX:objectClass}}.  The values of the {{EX:objectClass}}
99 attribute determine the {{schema}} rules the entry must obey.
100
101 {{How is the information referenced?}} An entry is referenced by
102 its distinguished name, which is constructed by taking the name of
103 the entry itself (called the {{TERM[expand]RDN}} or RDN) and
104 concatenating the names of its ancestor entries. For example, the
105 entry for Barbara Jensen in the Internet naming example above has
106 an RDN of {{EX:uid=babs}} and a DN of
107 {{EX:uid=babs,ou=People,dc=example,dc=com}}. The full DN format
108 is described in {{REF:RFC2253}}, "Lightweight Directory Access
109 Protocol (v3):  UTF-8 String Representation of Distinguished Names."
110
111 {{How is the information accessed?}} LDAP defines operations for
112 interrogating and updating the directory.  Operations are provided
113 for adding and deleting an entry from the directory, changing an
114 existing entry, and changing the name of an entry. Most of the
115 time, though, LDAP is used to search for information in the directory.
116 The LDAP search operation allows some portion of the directory to
117 be searched for entries that match some criteria specified by a
118 search filter. Information can be requested from each entry that
119 matches the criteria.
120
121 For example, you might want to search the entire directory subtree
122 at and below {{EX:dc=example,dc=com}} for people with the name
123 {{EX:Barbara Jensen}}, retrieving the email address of each entry
124 found. LDAP lets you do this easily.  Or you might want to search
125 the entries directly below the {{EX:st=California,c=US}} entry for
126 organizations with the string {{EX:Acme}} in their name, and that
127 have a fax number. LDAP lets you do this too. The next section
128 describes in more detail what you can do with LDAP and how it might
129 be useful to you.
130
131 {{How is the information protected from unauthorized access?}} Some
132 directory services provide no protection, allowing anyone to see
133 the information. LDAP provides a mechanism for a client to
134 authenticate, or prove its identity to a directory server, paving
135 the way for rich access control to protect the information the
136 server contains.  LDAP also supports privacy and integrity security
137 services.
138
139
140 H2: How does LDAP work?
141
142 LDAP directory service is based on a {{client-server}} model. One
143 or more LDAP servers contain the data making up the directory
144 information tree (DIT).  The client connects to servers and
145 asks it a question.  The server responds with an answer and/or 
146 with a pointer to where the client can get additional information
147 (typically, another LDAP server).  No matter which LDAP server a
148 client connects to, it sees the same view of the directory; a name
149 presented to one LDAP server references the same entry it would at
150 another LDAP server. This is an important feature of a global
151 directory service, like LDAP.
152
153
154 H2: What about X.500?
155
156 Technically, {{TERM:LDAP}} is a directory access protocol to an
157 {{TERM:X.500}} directory service, the {{TERM:OSI}} directory service.
158 Initially, LDAP clients accessed gateways to the X.500 directory service.
159 This gateway ran LDAP between the client and gateway and X.500's
160 {{TERM[expand]DAP}} ({{TERM:DAP}}) between the gateway and the
161 X.500 server.  DAP is a heavyweight protocol that operates over a
162 full OSI protocol stack and requires a significant amount of
163 computing resources.  LDAP is designed to operate over
164 {{TERM:TCP}}/{{TERM:IP}} and provides most of the functionality of
165 DAP at a much lower cost.
166
167 While LDAP is still used to access X.500 directory service via
168 gateways, LDAP is now more commonly directly implemented in X.500
169 servers. 
170
171 The stand-alone LDAP daemon, or {{slapd}}(8), can be viewed as a
172 {{lightweight}} X.500 directory server.  That is, it does not
173 implement the X.500's DAP.  As a {{lightweight directory}} server,
174 {{slapd}}(8) implements only a subset of the X.500 models.
175
176 If you are already running a X.500 DAP service and you want to
177 continue to do so, you can probably stop reading this guide.  This
178 guide is all about running LDAP via {{slapd}}(8), without running
179 X.500 DAP.  If you are not running X.500 DAP, want to stop running
180 X.500 DAP, or have no immediate plans to run X.500 DAP, read on.
181
182 It is possible to replicate data from an LDAP directory server to
183 a X.500 DAP {{TERM:DSA}}.  This requires an LDAP/DAP gateway.
184 OpenLDAP does not provide such a gateway, but our replication daemon
185 can be used to replicate to such a gateway.  See the {{SECT:Replication
186 with slurpd}} chapter of this document for information regarding
187 replication.
188
189
190 H2: What is the difference between LDAPv2 and LDAPv3?
191
192 LDAPv3 was developed in the late 1990's to replace LDAPv2.
193 LDAPv3 adds the following features to LDAP:
194
195  - Strong Authentication via {{TERM:SASL}}
196  - Integrity and Confidentiality Protection via {{TERM:TLS}} (SSL)
197  - Internationalization through the use of Unicode
198  - Referrals and Continuations
199  - Extensibility (controls and extended operations)
200  - Schema Discovery
201
202 LDAPv2 is considered historical.  As deploying both LDAPv2 and
203 LDAPv3 simultaneously can be quite problematic, LDAPv2 should
204 be avoided.
205
206
207 H2: What is slapd and what can it do?
208
209 {{slapd}}(8) is an LDAP directory server that runs on many different
210 platforms. You can use it to provide a directory service of your
211 very own.  Your directory can contain pretty much anything you want
212 to put in it. You can connect it to the global LDAP directory
213 service, or run a service all by yourself. Some of slapd's more
214 interesting features and capabilities include:
215
216 {{B:LDAPv3}}: {{slapd}} implements version 3 of {{TERM[expand]LDAP}}.
217 {{slapd}} supports LDAP over both IPv4 and IPv6.
218
219 {{B:{{TERM[expand]SASL}}}}: {{slapd}} supports strong authentication
220 services through the use of SASL.  {{slapd}}'s SASL implementation
221 utilizes {{PRD:Cyrus}} {{PRD:SASL}} software which supports a number
222 of mechanisms including DIGEST-MD5, EXTERNAL, and GSSAPI.
223
224 {{B:{{TERM[expand]TLS}}}}: {{slapd}} provides privacy and integrity
225 protections through the use of TLS (or SSL).  {{slapd}}'s TLS
226 implementation utilizes {{PRD:OpenSSL}} software.
227
228 {{B:Topology control}}: {{slapd}} allows one to restrict access to
229 the server based upon network topology.  This feature utilizes
230 {{TCP wrappers}}.
231
232 {{B:Access control}}: {{slapd}} provides a rich and powerful access
233 control facility, allowing you to control access to the information
234 in your database(s). You can control access to entries based on
235 LDAP authorization information, {{TERM:IP}} address, domain name
236 and other criteria.  {{slapd}} supports both {{static}} and
237 {{dynamic}} access control information.
238
239 {{B:Internationalization}}: {{slapd}} supports Unicode and language
240 tags.
241
242 {{B:Choice of database backends}}: {{slapd}} comes with a variety
243 of different database backends you can choose from. They include
244 {{TERM:BDB}}, a high-performance transactional database backend;
245 {{TERM:LDBM}}, a lightweight DBM based backend; {{SHELL}}, a backend
246 interface to arbitrary shell scripts; and PASSWD, a simple backend
247 interface to the {{passwd}}(5) file.  BDB utilizes {{ORG:Sleepycat}}
248 {{PRD:Berkeley DB}}.  LDBM utilizes either {{PRD:Berkeley DB}} or
249 {{PRD:GDBM}}.
250
251 {{B:Multiple database instances}}: {{slapd}} can be configured to
252 serve multiple databases at the same time. This means that a single
253 {{slapd}} server can respond to requests for many logically different
254 portions of the LDAP tree, using the same or different database
255 backends.
256
257 {{B:Generic modules API}}: If you require even more customization,
258 {{slapd}} lets you write your own modules easily. {{slapd}} consists
259 of two distinct parts: a front end that handles protocol communication
260 with LDAP clients; and modules which handle specific tasks such as
261 database operations. Because these two pieces communicate via a
262 well-defined {{TERM:C}} {{TERM:API}}, you can write your own
263 customized modules which extend {{slapd}} in numerous ways.  Also,
264 a number of {{programmable database}} modules are provided.  These
265 allow you to expose external data sources to {{slapd}} using popular
266 programming languages ({{PRD:Perl}}, {{shell}}, {{PRD:SQL}}, and
267 {{PRD:TCL}}).
268
269 {{B:Threads}}: {{slapd}} is threaded for high performance.  A single
270 multi-threaded {{slapd}} process handles all incoming requests
271 using a pool of threads.  This reduces the amount of system overhead
272 required while providing high performance.
273
274 {{B:Replication}}: {{slapd}} can be configured to maintain replica
275 copies of its database. This {{single-master/multiple-slave}}
276 replication scheme is vital in high-volume environments where a
277 single {{slapd}} just doesn't provide the necessary availability
278 or reliability.  {{slapd}} also includes experimental support for
279 {{multi-master}} replication.
280
281 {{B:Configuration}}: {{slapd}} is highly configurable through a
282 single configuration file which allows you to change just about
283 everything you'd ever want to change.  Configuration options have
284 reasonable defaults, making your job much easier.
285
286 {{slapd}} also has its limitations, of course.  The main BDB
287 backend does not handle range queries or negation queries
288 very well.
289
290
291 H2: What is slurpd and what can it do?
292
293 {{slurpd}}(8) is a daemon that helps {{slapd}} provide replicated
294 service. It is responsible for distributing changes made to the
295 master {{slapd}} database out to the various {{slapd}} replicas.
296 It frees {{slapd}} from having to worry that some replicas might
297 be down or unreachable when a change comes through; {{slurpd}}
298 handles retrying failed requests automatically.  {{slapd}} and
299 {{slurpd}} communicate through a simple text file that is used to
300 log changes.
301
302 See the {{SECT:Replication with slurpd}} chapter for information
303 about how to configure and run {{slurpd}}(8).