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