]> git.sur5r.net Git - openldap/blob - doc/guide/admin/intro.sdf
Happy new year!
[openldap] / doc / guide / admin / intro.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2006 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 authenticate,
136 or prove its identity to a directory server, paving the way for
137 rich access control to protect the information the server contains.
138 LDAP also supports data security (integrity and confidentiality)
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 nor does it support the complete X.500
176 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 and data security services via {{TERM:SASL}}
198  - Certificate authentication and data security services 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 {{so-called}} LDAPv2
205 implementations (including {{slapd}}(8)) do not conform to the
206 LDAPv2 technical specification, interoperatibility amongst
207 implementations claiming LDAPv2 support is limited.  As LDAPv2
208 differs significantly from LDAPv3, deploying both LDAPv2 and LDAPv3
209 simultaneously is 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 and Unix IPC.
224
225 {{B:{{TERM[expand]SASL}}}}: {{slapd}} supports strong authentication
226 and data security (integrity and confidentiality) services through
227 the use of SASL.  {{slapd}}'s SASL implementation utilizes {{PRD:Cyrus}}
228 {{PRD:SASL}} software which supports a number of mechanisms including
229 DIGEST-MD5, EXTERNAL, and GSSAPI.
230
231 {{B:{{TERM[expand]TLS}}}}: {{slapd}} supports certificate-based
232 authentication and data security (integrity and confidentiality)
233 services through the use of TLS (or SSL).  {{slapd}}'s TLS
234 implementation utilizes {{PRD:OpenSSL}} software.
235
236 {{B:Topology control}}: {{slapd}} can be configured to restrict
237 access at the socket layer based upon network topology information.
238 This feature utilizes {{TCP wrappers}}.
239
240 {{B:Access control}}: {{slapd}} provides a rich and powerful access
241 control facility, allowing you to control access to the information
242 in your database(s). You can control access to entries based on
243 LDAP authorization information, {{TERM:IP}} address, domain name
244 and other criteria.  {{slapd}} supports both {{static}} and {{dynamic}}
245 access control information.
246
247 {{B:Internationalization}}: {{slapd}} supports Unicode and language
248 tags.
249
250 {{B:Choice of database backends}}: {{slapd}} comes with a variety
251 of different database backends you can choose from. They include
252 {{TERM:BDB}}, a high-performance transactional database backend;
253 {{TERM:HDB}}, a hierarchical high-performance transactional backend;
254 {{TERM:LDBM}}, a lightweight DBM based backend; {{SHELL}}, a backend
255 interface to arbitrary shell scripts; and PASSWD, a simple backend
256 interface to the {{passwd}}(5) file.  The BDB and HDB backends
257 utilize {{ORG:Sleepycat}} {{PRD:Berkeley DB}}.  The LDBM utilizes
258 either {{PRD:Berkeley DB}} or {{PRD:GDBM}}.
259
260 {{B:Multiple database instances}}: {{slapd}} can be configured to
261 serve multiple databases at the same time. This means that a single
262 {{slapd}} server can respond to requests for many logically different
263 portions of the LDAP tree, using the same or different database
264 backends.
265
266 {{B:Generic modules API}}:  If you require even more customization,
267 {{slapd}} lets you write your own modules easily. {{slapd}} consists
268 of two distinct parts: a front end that handles protocol communication
269 with LDAP clients; and modules which handle specific tasks such as
270 database operations.  Because these two pieces communicate via a
271 well-defined {{TERM:C}} {{TERM:API}}, you can write your own
272 customized modules which extend {{slapd}} in numerous ways.  Also,
273 a number of {{programmable database}} modules are provided.  These
274 allow you to expose external data sources to {{slapd}} using popular
275 programming languages ({{PRD:Perl}}, {{shell}}, {{PRD:SQL}}, and
276 {{PRD:TCL}}).
277
278 {{B:Threads}}: {{slapd}} is threaded for high performance.  A single
279 multi-threaded {{slapd}} process handles all incoming requests using
280 a pool of threads.  This reduces the amount of system overhead
281 required while providing high performance.
282
283 {{B:Replication}}: {{slapd}} can be configured to maintain shadow
284 copies of directory information.  This {{single-master/multiple-slave}}
285 replication scheme is vital in high-volume environments where a
286 single {{slapd}} just doesn't provide the necessary availability
287 or reliability. {{slapd}} supports two replication methods: {{LDAP
288 Sync}}-based and {{slurpd}}(8)-based replication.
289
290 {{B:Proxy Cache}}: {{slapd}} can be configured as a caching
291 LDAP proxy service.
292
293 {{B:Configuration}}: {{slapd}} is highly configurable through a
294 single configuration file which allows you to change just about
295 everything you'd ever want to change.  Configuration options have
296 reasonable defaults, making your job much easier.
297
298
299 H2: What is slurpd and what can it do?
300
301 {{slurpd}}(8) is a daemon that, with {{slapd}} help, provides
302 replicated service.  It is responsible for distributing changes
303 made to the master {{slapd}} database out to the various {{slapd}}
304 replicas.  It frees {{slapd}} from having to worry that some replicas
305 might be down or unreachable when a change comes through; {{slurpd}}
306 handles retrying failed requests automatically.  {{slapd}} and
307 {{slurpd}} communicate through a simple text file that is used to
308 log changes.
309
310 See the {{SECT:Replication with slurpd}} chapter for information
311 about how to configure and run {{slurpd}}(8).
312
313 Alternatively, {{LDAP-Sync}}-based replication may be used to provide
314 a replicated service.  See the {{SECT:LDAP Sync Replication}} chapter
315 for details.
316