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