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