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