]> git.sur5r.net Git - openldap/blob - doc/guide/admin/quickstart.sdf
b3df4af094768324a4b5e415c0fe106ffab127af
[openldap] / doc / guide / admin / quickstart.sdf
1 # $OpenLDAP$
2 # Copyright 1999, 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 . {{I:Slapd}} is part of the OpenLDAP distribution, which
15 you can retrieve using this URL:
16
17 ..{{URL: ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release.tgz}}
18
19 .If you are reading this guide, you have probably already done this.
20
21
22 + {{B:Untar the distribution}}.
23 .Pick a place for the LDAP source to live, cd
24 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 ldap}}
29
30 + {{B: Configure the software}}.
31 . You will need to run the configure script to configure slapd.
32
33 .{{EX:./configure}}
34
35 . Configure accepts many command line options that enable or disable
36 optional features in slapd.  Usually the defaults are okay, but you
37 may want to change them.  To get a complete list of options that configure 
38 accepts, use the --help option.
39
40 .{{EX:./configure --help}}
41
42 . Once OpenLDAP has been configured, it needs to be compiled.  
43 You'll need to make dependencies and then compile the software.
44 For example:
45
46 .{{EX:make depend}}
47 .{{EX:make}}
48
49 . Once OpenLDAP is compiled you need to install it.  By default OpenLDAP 
50 is installed into /usr/local.  This is typically done as root.
51
52 .{{EX:su root}}
53 .{{EX:make install}}
54
55 + {{B:Edit the configuration file}}.
56 . Use this section as a brief guide.  For more details on the configuration
57 file, see chapter 5.
58
59 . Now we need to edit the default configuration file that was installed
60 earlier.  By default the configuration file for slapd is located at
61 {{FILE:/usr/local/etc/openldap/slapd.conf}}.  If you specified the --prefix
62 option when you ran configure, then replace {{FILE:/usr/local}} with the
63 value you gave as the prefix. 
64
65 . For example, if you ran configure as
66 .{{EX:./configure --prefix=/opt/ldap}}
67 . You would find your configuration file in {{FILE:/opt/ldap/etc/openldap/slapd.conf}}. 
68
69 . Now look in the configuration file for a line that begins with 
70 .{{EX:database          ldbm}}  
71
72 . This marks the begining of the database configuration for slapd.  Everything 
73 you will need to change for this example is located after the line begining with
74 .{{EX:database          ldbm}} 
75
76 . Listed below are the default settings for the database in {{FILE:slapd.conf}}.
77 Lines that begin with a # are considered to be comments by slapd, they have
78 been removed from the listing below to save space.
79
80 .{{EX:suffix          "dc=my-domain, dc=com"}}
81 .{{EX:rootdn          "cn=Manager, dc=my-domain, dc=com"}}
82 .{{EX:rootpw          secret}}
83 .{{EX:directory       /usr/local/var/openldap-ldbm}}
84
85 . Now we need to replace all of the references to my-domain with the correct
86 value.  For example, if your domain is example.net we might use the following.
87
88 .{{EX:suffix          "dc=example, dc=net"}}
89 .{{EX:rootdn          "cn=Manager, dc=example, dc=net"}}
90 .{{EX:rootpw          secret}}
91 .{{EX:directory       /usr/local/var/openldap-ldbm}}
92
93 + {{B:Create a database}}.
94 . This is a two-step process. Step A is to create
95 a file (we'll call it myldif) containing the entries you want your database
96 to contain. Use the following example as a guide, or see Section 7.3 for
97 more details.
98
99 .{{EX:dn: dc=example, dc=net}}
100 .{{EX:objectclass: dcObject}}
101 .{{EX:objectclass: organization}}
102 .{{EX:o: Example Net Inc.}}
103 .{{EX:dc: example}}
104 .
105 .{{EX:dn: cn=Bob Smith, dc=example, dc=net}}
106 .{{EX:objectclass: person}}
107 .{{EX:cn: Bob Smith}}
108 .{{EX:sn: Smith}}
109
110 .Remember to replace dc=example,dc=net with the correct values for your
111 site, and to put your name instead of Bob's.
112
113 .You can include additional entries and attributes in this file if you want,
114 or add them later via LDAP.
115
116 .Step B is to run this file through a tool to create the slapd database.
117
118 .First we'll need to start slapd.
119 To do this just run slapd.
120 .{{EX:/usr/local/libexec/slapd}}
121
122 .At this point the LDAP server is up and running, but there isn't any data
123 in the directory.  We can use ldapadd to populate the directory.
124 Again remember to replace dc=example,dc=net with the correct values for your
125 site.  By default ldapadd is installed as /usr/local/bin/ldapadd.
126
127 .{{EX:ldapadd -x -D"cn=Manager,dc=example,dc=net" -w secret -f myldif}}
128
129 .Where myldif is the file you made in step 7A above. By default, the database
130 files will be created in /usr/local/var/openldap-ldbm. You may specify an
131 alternate directory via the directory option in the slapd.conf file.
132
133 + {{B:See if it works}}.
134 . Now we're ready to try everything out.  
135
136 . You can use any LDAP client to do this, but our
137 example uses the ldapsearch tool.  Remember to replace dc=example,dc=net with
138 the correct values for your site.
139
140 .{{EX:ldapsearch -b 'dc=example,dc=net' '(objectclass=*)'}}
141
142 . This command will search for and retrieve every entry in the database.
143 Note the use of single quotes around the filter, which prevents the "*"
144 from being interpreted by the shell.
145
146 . You are now ready to add more entries (e.g., using {{I:ldapadd}}(1) or
147 another LDAP client), experiment with various configuration options,
148 backend arrangements, etc. Note that by default, the {{I:slapd}} database
149 grants {{EX:READ}} access to everybody. So if you want to add or modify
150 entries over LDAP, you will have to bind as the rootdn specified in the
151 config file (see Section 5.2.2), or change the default access control
152 (see Section 5.3).
153
154
155 The following sections provide more detailed information on making,
156 installing, and running slapd.
157