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