]> git.sur5r.net Git - openldap/blob - doc/guide/admin/quickstart.sdf
Mostly formating changes, use of classes
[openldap] / doc / guide / admin / quickstart.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4
5 H1: A Quick-Start Guide to Running slapd
6
7 This section provides a quick step-by-step guide to building,
8 installing and running {{I:slapd}}. It is intended to provide users with a
9 simple and quick way to get started only. If you intend to run slapd
10 seriously, you should read the rest of this guide.
11
12
13 ^{{B:Get the software}}.
14
15 .{{I:Slapd}} is part of the OpenLDAP distribution, which
16 you can retrieve from {{URL: http://www.openldap.org/software/download/}}
17 or {{URL: ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release.tgz}}.
18 If you are reading this guide, you have probably already done this.
19
20 .{{S: }}
21 +{{B:Unpack the distribution}}.
22
23 .Pick a directory for the LDAP source to live under and change
24 directory there, and untar it. For example:
25
26 ..{{EX:cd /usr/local/src}}
27 ..{{EX:gunzip -c openldap-release.tgz | tar xvfB -}}
28 ..{{EX:cd openldap-release}}
29
30 . You'll have to replace {{F:openldap-release}} with the full
31 name of the release.
32
33
34 .{{S: }}
35 +{{B: Configure the software}}.
36
37 .You will need to run the configure script to configure slapd.
38
39 ..{{EX:./configure}}
40
41 . Configure accepts many command line options that enable or disable
42 optional features in slapd.  Usually the defaults are okay, but you
43 may want to change them.  To get a complete list of options that configure 
44 accepts, use the {{EX:--help}} option.
45
46 ..{{EX:./configure --help}}
47
48 . Once OpenLDAP has been configured, it needs to be compiled.  
49 You'll need to make dependencies and then compile the software.
50 For example:
51
52 ..{{EX:make depend}}
53 ..{{EX:make}}
54
55 . Once OpenLDAP is compiled you need to install it.  By default OpenLDAP 
56 is installed into {{F:/usr/local}}.  This is typically done as root.
57
58 ..{{EX:su root}}
59 ..{{EX:make install}}
60
61
62 .{{S: }}
63 +{{B:Edit the configuration file}}.
64
65 .Use this section as a brief guide.  For more details on the configuration
66 file, see chapter 5.
67
68 .Now we need to edit the default configuration file that was
69 installed earlier.  The slapd configuration file {{I:slapd.conf}}(5)
70 for is normally located at {{F:/usr/local/etc/openldap/slapd.conf}}.
71 If you specified the {{EX:--prefix}} option when you ran configure,
72 then replace {{F:/usr/local}} with the value you gave as the
73 prefix.  For example, if you ran configure as
74
75 ..{{EX:./configure --prefix=/opt/ldap}}
76
77 .You would find your configuration file in
78 {{F:/opt/ldap/etc/openldap/slapd.conf}}. 
79 Now look in the configuration file for a line that begins with 
80
81 ..{{EX:database          ldbm}}
82
83 .This marks the begining of the database configuration for slapd.
84 Everything you will need to change for this example is located
85 after this line.
86
87 .Listed below are the default settings for the database in
88 {{F:slapd.conf}}(5).  Lines that begin with a sharp sign ('#')
89 are considered to be comments by slapd, they have been removed
90 from the listing below to save space.  If a line starts with
91 white space it is considered a continuation of the preceeding
92 line.
93
94 ..{{EX:suffix          "dc=my-domain, dc=com"}}
95 ..{{EX:rootdn          "cn=Manager, dc=my-domain, dc=com"}}
96 ..{{EX:rootpw          secret}}
97 ..{{EX:directory       /usr/local/var/openldap-ldbm}}
98
99 . Now we need to replace all of the references to {{EX:my-domain}}
100 and {{EX:com}} with the correct value.  For example, if your domain
101 is {{EX:example.net}} we might use the following.
102
103 ..{{EX:suffix          "dc=example, dc=net"}}
104 ..{{EX:rootdn          "cn=Manager, dc=example, dc=net"}}
105 ..{{EX:rootpw          secret}}
106 ..{{EX:directory       /usr/local/var/openldap-ldbm}}
107
108 . By default, the database files will be created in
109 {{F:/usr/local/var/openldap-ldbm}}.
110 You may specify an alternate directory via the directory option
111 in the {{F:slapd.conf}} file.  The directory must exist before
112 you start the server.
113
114
115 .{{S: }}
116 +{{B:Starting the server}}.
117
118 .You are now ready to start the server by running the command
119 {{I:slapd}}(8):
120
121 ..{{EX:/usr/local/libexec/slapd}}
122
123 . At this point the LDAP server is up and running, but there isn't
124 any data in the directory.  You can check to see if the server is
125 running and your naming context (the {{EX:suffix}} you specified above)
126 by searching it with {{I:ldapsearch}}(1).  By default ldapsearch is
127 installed as {{F:/usr/local/bin/ldapsearch}}.
128
129 ..{{EX:ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts}}
130
131 .Note the use of single quotes around command parameters to prevent
132 special characters from interpreted by the shell.  This should return:
133
134 ..{{EX:dn:}}
135 ..{{EX:namingContexts: dc=example, dc=net}}
136
137
138 .{{S: }}
139 +{{B:Create a database}}.
140
141 . This is a two-step process. The first step is to create a file
142 (we'll call it {{F:example.ldif}}) containing the entries you
143 want your database to contain. Use the following example as a
144 guide, or see Section 7.3 for more details.
145
146 ..{{EX:dn: dc=example, dc=net}}
147 ..{{EX:objectclass: dcObject}}
148 ..{{EX:objectclass: organization}}
149 ..{{EX:o: Example Network}}
150 ..{{EX:dc: example}}
151 ..{{EX: }}
152 ..{{EX:dn: cn=Bob Smith, dc=example, dc=net}}
153 ..{{EX:objectclass: person}}
154 ..{{EX:cn: Bob Smith}}
155 ..{{EX:sn: Smith}}
156
157 .Remember to replace {{EX:dc=example, dc=net}} with the correct
158 values for your site, and to put your name instead of Bob's.  You can
159 include additional entries and attributes in this file if you want,
160 or add them later via LDAP.
161
162 .The second step is to run a tool to add the contents of this file to the
163 your directory.  We use the tool {{I:ldapadd}}(1) to populate the directory.
164 Again remember to replace {{EX:dc=example, dc=net}} with the correct values
165 for your site.  By default ldapadd is installed as
166 {{F:/usr/local/bin/ldapadd}}.
167
168 ..{{EX:ldapadd -x -D 'cn=Manager,dc=example,dc=net' -w secret -f example.ldif}}
169
170 .Where {{F:example.ldif}} is the file you created above.
171
172 .{{S: }}
173 +{{B:See if it works}}.
174
175 .Now we're ready to verify the added entries are in your directory.  
176 You can use any LDAP client to do this, but our example uses the
177 {{I:ldapsearch}}(1) tool.  Remember to replace {{EX:dc=example,dc=net}}
178 with the correct values for your site.
179
180 ..{{EX:ldapsearch -x -b 'dc=example,dc=net' '(objectclass=*)'}}
181
182 .This command will search for and retrieve every entry in the database.
183
184 You are now ready to add more entries using {{I:ldapadd}}(1) or
185 another LDAP client, experiment with various configuration options,
186 backend arrangements, etc. Note that by default, the {{I:slapd}}(8)
187 database grants {{I:read access to everybody}}. So if you want to add
188 or modify entries over LDAP, you will have to bind as the {{EX:rootdn}}
189 specified in the config file (see Section 5.2.2), or change the
190 default access control (see Section 5.3).
191
192
193 The following sections provide more detailed information on making,
194 installing, and running {{I:slapd}}(8).
195