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