]> git.sur5r.net Git - openldap/blob - doc/guide/admin/intro.sdf
ce8b021d96165f10c8fb2a5f4a1718536f49a799
[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}} {{PRD:SASL}} software
161 which supports a number of mechanisms including
162 DIGEST-MD5, EXTERNAL, and GSSAPI.
163
164 {{B:{{TERM[expand]TLS}}}}: {{slapd}} provides privacy and 
165 integrity protections through the use of TLS (or SSL).  {{slapd}}'s
166 TLS implementation utilizes {{PRD:OpenSSL}} software.
167
168 {{B:Access control}}: {{slapd}} provides a rich and powerful access 
169 control facility, allowing you to control access to the information 
170 in your database(s). You can control access to entries based on 
171 LDAP authorization information, {{TERM:IP}} address, domain name
172 and other criteria.
173 {{slapd}} supports both {{static}} and {{dynamic}} access control
174 information.
175
176 {{B:Internationalization}}: {{slapd}} supports Unicode and language
177 tags.
178
179 {{B:Choice of databases}}: {{slapd}} comes with a variety of different
180 backend databases you can choose from. They include
181 {{TERM:LDBM}}, a high-performance disk-based embedded database;
182 SHELL, a database interface to arbitrary shell scripts; and
183 PASSWD, a simple password file database.  LDBM utilizes either
184 {{PRD:BerkeleyDB}} or {{PRD:GDBM}}.
185
186 {{B:Multiple database instances}}: {{slapd}} can be configured to serve 
187 multiple databases at the same time. This means that a single {{slapd}}
188 server can respond to requests for many logically different portions 
189 of the LDAP tree, using the same or different backend databases.
190
191 {{B:Generic modules API}}: If you require even more customization,
192 {{slapd}} lets you write your own modules easily. {{slapd}} 
193 consists of two distinct parts: a front end that handles protocol 
194 communication with LDAP clients; and modules which handles specific
195 tasks such as database operations. Because these two pieces communicate
196 via a well-defined C API, you can write your own customized modules
197 which extend {{slapd}} in numerous ways.  Also, a number of
198 {{programmable database}} modules are provided.  These allowing you
199 to expose external data sources to {{slapd}} using popular programming
200 languages ({{PRD:Perl}}, {{Shell}}, {{PRD:SQL}}, and {{PRD:TCL}}.
201
202 {{B:Threads}}: {{slapd}} is threaded for high performance. A 
203 single multi-threaded {{slapd}} process handles all incoming 
204 requests, reducing the amount of system overhead required.
205
206 {{B:Replication}}: {{slapd}} can be configured to maintain replica 
207 copies of its database. This {{single-master/multiple-slave}}
208 replication scheme is vital in high-volume environments where a
209 single {{slapd}} just doesn't provide the necessary availability
210 or reliability.  {{slapd}}
211 also includes experimental support for {{multi-master}} replication.
212
213 {{B:Configuration}}: {{slapd}} is highly configurable through a 
214 single configuration file which allows you to change just about 
215 everything you'd ever want to change.  Configuration options have 
216 reasonable defaults, making your job much easier.
217
218 {{slapd}} also has its limitations, of course. The main LDBM
219 database backend does not handle range queries or negation queries
220 very well. These features and more will be coming in a future release.
221
222
223
224 H2: What about X.500?
225
226 Technically, LDAP is a directory access protocol to an {{TERM:X.500}}
227 directory service, the {{TERM:OSI}} directory service.  Initial
228 LDAP servers were gateway between LDAP and the X.500 {{TERM[expand]DAP}}
229 ({{TERM:DAP}}).  DAP is a heavyweight protocol that operates over a full
230 OSI protocol stack and requires a significant amount of computing
231 resources.  LDAP is designed to operate over {{TERM:TCP}}/{{TERM:IP}}
232 and provides most of the functionality of DAP at a much lower cost.
233
234 This use of LDAP makes it easy to access the X.500 directory, but still
235 requires a full X.500 service to make data available to the many LDAP
236 clients being developed. As with full X.500 DAP clients, a full X.500
237 DAP server is no small piece of software to operate.
238
239 The stand-alone LDAP daemon, or {{slapd}}(8), is meant to remove much
240 of the burden from the server side just as LDAP itself removed much of
241 the burden from clients. If you are already running a X.500 DAP service
242 and you want to continue to do so, you can probably stop reading this
243 guide, which is all about running LDAP via {{slapd}}, without running
244 X.500 DAP. If you are not running X.500 DAP, want to stop running
245 X.500 DAP, or have no immediate plans to run X.500 DAP, read on.
246
247 It is possible to replicate data from a {{slapd}} directory 
248 server to a X.500 {{TERM:DSA}}, which allows your organization to
249 make your data available as part of the global X.500 DAP directory
250 service on a {{read-only}} basis.  See the
251 {{SECT:Replication to an X.500 DSA}}
252 section in the
253 {{SECT:Replication with slurpd}} chapter of this document.
254
255 Another way to make data in a {{slapd}} server available to the
256 X.500 community would be by using a X.500 DAP to LDAP gateway. At
257 this time, no such software has been written (to the best of our
258 knowledge), but hopefully some group will see fit to write such a
259 gateway.
260
261
262 H2: What is slurpd and what can it do?
263
264 {{slurpd}}(8) is a daemon that helps {{slapd}} provide 
265 replicated service. It is responsible for distributing changes made 
266 to the master {{slapd}} database out to the various {{slapd}} 
267 replicas. It frees {{slapd}} from having to worry that some
268 replicas might be down or unreachable when a change comes through;
269 {{slurpd}} handles retrying failed requests automatically. 
270 {{slapd}} and {{slurpd}} communicate through a simple text 
271 file that is used to log changes.
272
273 See the {{SECT:Replication with slurpd}} chapter for information
274 about how to configure and run {{slurpd}}(8).