]> 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-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.  LDAP is an {{ORG:IETF}} Standard Track protocol and is
56 specified as detailed in "Lightweight Directory Access Protocol
57 (LDAP) Technical Specification Road Map" {{REF:RFC4510}}.
58
59 This section gives an overview of LDAP from a
60 user's perspective.
61
62 {{What kind of information can be stored in the directory?}} The
63 LDAP information model is based on {{entries}}. An entry is a
64 collection of attributes that has a globally-unique {{TERM[expand]DN}}
65 (DN).  The DN is used to refer to the entry unambiguously. Each of
66 the entry's attributes has a {{type}} and one or more {{values}}.
67 The types are typically mnemonic strings, like "{{EX:cn}}" for
68 common name, or "{{EX:mail}}" for email address. The syntax of
69 values depend on the attribute type.  For example, a {{EX:cn}}
70 attribute might contain the value {{EX:Babs Jensen}}.  A {{EX:mail}}
71 attribute might contain the value "{{EX:babs@example.com}}". A
72 {{EX:jpegPhoto}} attribute would contain a photograph in the JPEG
73 (binary) format.
74
75 {{How is the information arranged?}} In LDAP, directory entries
76 are arranged in a hierarchical tree-like structure.  Traditionally,
77 this structure reflected the geographic and/or organizational
78 boundaries.  Entries representing countries appear at the top of
79 the tree. Below them are entries representing states and national
80 organizations. Below them might be entries representing organizational
81 units, people, printers, documents, or just about anything else
82 you can think of.  Figure 1.1 shows an example LDAP directory tree
83 using traditional naming.
84
85 !import "intro_tree.gif"; align="center"; \
86         title="LDAP directory tree (traditional naming)"
87 FT[align="Center"] Figure 1.1: LDAP directory tree (traditional naming)
88
89 The tree may also be arranged based upon Internet domain names.
90 This naming approach is becoming increasing popular as it allows
91 for directory services to be located using the {{DNS}}.
92 Figure 1.2 shows an example LDAP directory tree using domain-based
93 naming.
94
95 !import "intro_dctree.gif"; align="center"; \
96         title="LDAP directory tree (Internet naming)"
97 FT[align="Center"] Figure 1.2: LDAP directory tree (Internet naming)
98
99 In addition, LDAP allows you to control which attributes are required
100 and allowed in an entry through the use of a special attribute
101 called {{EX:objectClass}}.  The values of the {{EX:objectClass}}
102 attribute determine the {{schema}} rules the entry must obey.
103
104 {{How is the information referenced?}} An entry is referenced by
105 its distinguished name, which is constructed by taking the name of
106 the entry itself (called the {{TERM[expand]RDN}} or RDN) and
107 concatenating the names of its ancestor entries. For example, the
108 entry for Barbara Jensen in the Internet naming example above has
109 an RDN of {{EX:uid=babs}} and a DN of
110 {{EX:uid=babs,ou=People,dc=example,dc=com}}. The full DN format
111 is described in {{REF:RFC4514}}, "LDAP: String Representation of
112 Distinguished Names."
113
114 {{How is the information accessed?}} LDAP defines operations for
115 interrogating and updating the directory.  Operations are provided
116 for adding and deleting an entry from the directory, changing an
117 existing entry, and changing the name of an entry. Most of the
118 time, though, LDAP is used to search for information in the directory.
119 The LDAP search operation allows some portion of the directory to
120 be searched for entries that match some criteria specified by a
121 search filter. Information can be requested from each entry that
122 matches the criteria.
123
124 For example, you might want to search the entire directory subtree
125 at and below {{EX:dc=example,dc=com}} for people with the name
126 {{EX:Barbara Jensen}}, retrieving the email address of each entry
127 found. LDAP lets you do this easily.  Or you might want to search
128 the entries directly below the {{EX:st=California,c=US}} entry for
129 organizations with the string {{EX:Acme}} in their name, and that
130 have a fax number. LDAP lets you do this too. The next section
131 describes in more detail what you can do with LDAP and how it might
132 be useful to you.
133
134 {{How is the information protected from unauthorized access?}} Some
135 directory services provide no protection, allowing anyone to see
136 the information. LDAP provides a mechanism for a client to authenticate,
137 or prove its identity to a directory server, paving the way for
138 rich access control to protect the information the server contains.
139 LDAP also supports data security (integrity and confidentiality)
140 services.
141
142
143 H2: How does LDAP work?
144
145 LDAP directory service is based on a {{client-server}} model. One
146 or more LDAP servers contain the data making up the directory
147 information tree (DIT).  The client connects to servers and
148 asks it a question.  The server responds with an answer and/or 
149 with a pointer to where the client can get additional information
150 (typically, another LDAP server).  No matter which LDAP server a
151 client connects to, it sees the same view of the directory; a name
152 presented to one LDAP server references the same entry it would at
153 another LDAP server. This is an important feature of a global
154 directory service, like LDAP.
155
156
157 H2: What about X.500?
158
159 Technically, {{TERM:LDAP}} is a directory access protocol to an
160 {{TERM:X.500}} directory service, the {{TERM:OSI}} directory service.
161 Initially, LDAP clients accessed gateways to the X.500 directory service.
162 This gateway ran LDAP between the client and gateway and X.500's
163 {{TERM[expand]DAP}} ({{TERM:DAP}}) between the gateway and the
164 X.500 server.  DAP is a heavyweight protocol that operates over a
165 full OSI protocol stack and requires a significant amount of
166 computing resources.  LDAP is designed to operate over
167 {{TERM:TCP}}/{{TERM:IP}} and provides most of the functionality of
168 DAP at a much lower cost.
169
170 While LDAP is still used to access X.500 directory service via
171 gateways, LDAP is now more commonly directly implemented in X.500
172 servers. 
173
174 The stand-alone LDAP daemon, or {{slapd}}(8), can be viewed as a
175 {{lightweight}} X.500 directory server.  That is, it does not
176 implement the X.500's DAP nor does it support the complete X.500
177 models.
178
179 If you are already running a X.500 DAP service and you want to
180 continue to do so, you can probably stop reading this guide.  This
181 guide is all about running LDAP via {{slapd}}(8), without running
182 X.500 DAP.  If you are not running X.500 DAP, want to stop running
183 X.500 DAP, or have no immediate plans to run X.500 DAP, read on.
184
185 It is possible to replicate data from an LDAP directory server to
186 a X.500 DAP {{TERM:DSA}}.  This requires an LDAP/DAP gateway.
187 OpenLDAP does not provide such a gateway, but our replication daemon
188 can be used to replicate to such a gateway.  See the {{SECT:Replication
189 with slurpd}} chapter of this document for information regarding
190 replication.
191
192
193 H2: What is the difference between LDAPv2 and LDAPv3?
194
195 LDAPv3 was developed in the late 1990's to replace LDAPv2.
196 LDAPv3 adds the following features to LDAP:
197
198  - Strong authentication and data security services via {{TERM:SASL}}
199  - Certificate authentication and data security services via {{TERM:TLS}} (SSL)
200  - Internationalization through the use of Unicode
201  - Referrals and Continuations
202  - Schema Discovery
203  - Extensibility (controls, extended operations, and more)
204
205 LDAPv2 is historic ({{REF:RFC3494}}).  As most {{so-called}} LDAPv2
206 implementations (including {{slapd}}(8)) do not conform to the
207 LDAPv2 technical specification, interoperatibility amongst
208 implementations claiming LDAPv2 support is limited.  As LDAPv2
209 differs significantly from LDAPv3, deploying both LDAPv2 and LDAPv3
210 simultaneously is quite problematic.  LDAPv2 should be avoided.
211 LDAPv2 is disabled by default.
212
213
214 H2: What is slapd and what can it do?
215
216 {{slapd}}(8) is an LDAP directory server that runs on many different
217 platforms. You can use it to provide a directory service of your
218 very own.  Your directory can contain pretty much anything you want
219 to put in it. You can connect it to the global LDAP directory
220 service, or run a service all by yourself. Some of slapd's more
221 interesting features and capabilities include:
222
223 {{B:LDAPv3}}: {{slapd}} implements version 3 of {{TERM[expand]LDAP}}.
224 {{slapd}} supports LDAP over both IPv4 and IPv6 and Unix IPC.
225
226 {{B:{{TERM[expand]SASL}}}}: {{slapd}} supports strong authentication
227 and data security (integrity and confidentiality) services through
228 the use of SASL.  {{slapd}}'s SASL implementation utilizes {{PRD:Cyrus}}
229 {{PRD:SASL}} software which supports a number of mechanisms including
230 DIGEST-MD5, EXTERNAL, and GSSAPI.
231
232 {{B:{{TERM[expand]TLS}}}}: {{slapd}} supports certificate-based
233 authentication and data security (integrity and confidentiality)
234 services through the use of TLS (or SSL).  {{slapd}}'s TLS
235 implementation utilizes {{PRD:OpenSSL}} software.
236
237 {{B:Topology control}}: {{slapd}} can be configured to restrict
238 access at the socket layer based upon network topology information.
239 This feature utilizes {{TCP wrappers}}.
240
241 {{B:Access control}}: {{slapd}} provides a rich and powerful access
242 control facility, allowing you to control access to the information
243 in your database(s). You can control access to entries based on
244 LDAP authorization information, {{TERM:IP}} address, domain name
245 and other criteria.  {{slapd}} supports both {{static}} and {{dynamic}}
246 access control information.
247
248 {{B:Internationalization}}: {{slapd}} supports Unicode and language
249 tags.
250
251 {{B:Choice of database backends}}: {{slapd}} comes with a variety
252 of different database backends you can choose from. They include
253 {{TERM:BDB}}, a high-performance transactional database backend;
254 {{TERM:HDB}}, a hierarchical high-performance transactional
255 backend; {{SHELL}}, a backend interface to arbitrary shell scripts;
256 and PASSWD, a simple backend interface to the {{passwd}}(5) file.
257 The BDB and HDB backends utilize {{ORG:Sleepycat}} {{PRD:Berkeley
258 DB}}.
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