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