]> git.sur5r.net Git - openldap/blob - doc/guide/admin/install.sdf
0728e36fc8f909b957f5d0b26bae07ed85be6aba
[openldap] / doc / guide / admin / install.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4 H1: Building and Installing slapd & slurpd
5
6 Building and installing slapd requires three simple steps: configuring;
7 making; and installing. The following sections describe each step in
8 detail. If you are reading this guide, chances are you have already
9 obtained the software, but just in case, here's where you can get the
10 latest version of the OpenLDAP package, which includes all of the
11 software discussed in this guide:
12 {{URL: ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release.tgz}}
13
14 There is also an OpenLDAP Project has an extensive site on the
15 World Wide Web. This sites contains the latest OpenLDAP news,
16 release announcements, and pointers to other resources.
17 You can access the site at: {{URL: http://www.OpenLDAP.org/}}
18
19
20 H2: Pre-Build Configuration
21
22 Before building slapd, be sure to take a look at the README file in the
23 top level directory in the distribution so that you are familiar with the
24 general configuration and make process.
25
26 Briefly, you should edit the include/ldapconfig.h.edit and
27 Make-common files to contain the site-specific configuration your site
28 requires before making. The next sections discuss these steps in
29 more detail.
30
31
32 H3: Editing the {{EX: Make-common}} file
33
34 All of the general Make-common configuration variables (e.g.,
35 ETCDIR, BINDIR, etc.) apply to both slapd and slurpd. There are
36 additional Make-common configuration variables that also affect how
37 slapd and slurpd are built. They are:
38
39 H4: MAKE_SLAPD
40
41 This option controls whether slapd and slurpd get built at all. You
42 should set it to yes, like this:
43
44 E: MAKE_SLAPD = yes
45
46 H4: SLAPD_BACKENDS
47
48 This option controls which slapd backend databases get built. You
49 should set it to one or more of the following:
50
51 *{{EX: DLDAP_LDBM}} This is the main backend. It is a high-performance
52 disk-based database suitable for handling up to a million entries or so.
53 See the LDBMBACKEND and LDBMLIB options below.
54
55 *{{EX: DLDAP_PASSWD}} This is a simple search-only backend that can be
56 pointed at an {{EX: /etc/passwd}} file. It is intended more as an example than
57 as a real backend.
58
59 *{{EX: DLDAP_SHELL}} This backend allows the execution of arbitrary
60 system administrator-defined commands in response to LDAP
61 queries. The commands to execute are defined in the configuration file.
62 See Appendix B for more information on writing shell backend
63 programs.
64
65 Example to enable the LDBM and SHELL backends only:
66
67 E: SLAPD_BACKENDS= -DLDAP_LDBM -DLDAP_SHELL
68
69 The default is to build all three backends. Note that building a backend
70 only means that it can be enabled through the configuration file, not
71 that it will automatically be enabled.
72
73 H4: LDBMBACKEND
74
75 This option should only be defined if you have enabled the LDBM
76 backend as described above. The LDBM backend relies on a
77 low-level hash or B-tree package for its underlying database. This
78 option selects which package it will use. The currently supported
79 options in order of preference are:
80
81 *{{EX: DLDBM_USE_DBBTREE}}
82
83 .This option enables the Berkeley DB package btree database as the
84 LDBM backend. You can get this package from:
85 {{URL: ftp://ftp.cs.berkeley.edu/ucb/4bsd/db.tar.Z}}
86
87 *{{EX: DLDBM_USE_DBHASH}}
88
89 .This option enables the Berkeley DB package hash database as the
90 LDBM backend. You can get this package from
91 {{URL ftp://ftp.cs.berkeley.edu/ucb/4bsd/db.tar.Z}}
92
93 *{{EX: DLDBM_USE_GDBM}}
94
95 .This option enables GNU dbm as the LDBM backend. You can get this
96 package from
97 {{URL: ftp://prep.ai.mit.edu/pub/gnu/gdbm-1.7.3.tar.gz}}
98
99 *{{EX: DLDBM_USE_NDBM}}
100
101 .This option enables the standard UNIX ndbm(3) package as the
102 LDBM backend. This package should come standard on your UNIX
103 system. man ndbm for details.
104
105 Example to enable the Berkeley DB Btree backend:
106
107 E: LDBMBACKEND= -DLDBM_USE_DBBTREE
108
109 The default is -DLDBM_USE_NDBM, since it is the only one available
110 on all UNIX systems. NDBM has some serious limitations, though (not
111 thread-safe, severe size limits), and you are strongly encouraged to
112 use one of the other packages if you can.
113
114 Note[label='Note to Solaris users: '] If you are running under Solaris 2.x
115 and linking in an external database package (e.g., db or gdbm) it is
116 very important that you compile the package with the {{EX: D_REENTRANT}}
117 flag. If you do not, bad things will happen.
118
119 If you are using version 1.85 or earlier of the Berkeley db package, you
120 will need to apply the patch found in build/db.1.85.patch to the db
121 source before compiling it. You can do this with a command like this
122 from the db source area:
123
124 E: patch -p < ldap-source-directory/build/db.1.85.patch
125
126 H4: LDBMLIB
127
128 This option should only be defined if you have enabled the LDBM
129 backend as described above, and the necessary library for the
130 LDBMBACKEND option you chose above is not part of the standard C
131 library (i.e., anything other than NDBM). This option specifies the library
132 to link containing the package you selected, and optionally, its location.
133
134 Example to link with {{EX: libdb.a}}, contained in {{EX: /usr/local/lib}}:
135
136 E: LDBMLIB= -L/usr/local/lib -ldb
137
138 H4: THREADS
139
140 This option is normally set automatically in the {{EX: Make-platform}} file,
141 based on the platform on which you are building. You do not normally
142 need to set it. If you want to use a non-default threads package, you
143 can specify the appropriate {{EX: -Ddefine}} to enable it here.
144
145 H4: THREADSLIB
146
147 This option is normally set automatically in the {{EX: Make-platform}} file,
148 based on the platform on which you are building. You do not normally
149 need to set it. If you have set {{EX: THREADS}} to a non-default threads
150 package as described above, you can specify the appropriate
151 {{EX: -Ldirectory}} flag and  {{EX: -llibname}} flag needed to link
152 the package here.
153
154 H4: PHONETIC
155
156 This option controls the phonetic algorithm used by {{I: slapd}} when doing
157 approximate searches. The default is to use the metaphone algorithm.
158 You can have {{I: slapd}} use the soundex algorithm by setting this variable
159 to  {{EX: -DSOUNDEX}}.
160
161
162 H3: Editing the {{EX: include/ldapconfig.h}} file
163
164 In addition to setting the {{EX: LDAPHOST}} and {{EX: DEFAULT_BASE}} defines
165 near the top of this file, there are some slapd-specific defines near the
166 bottom of the file you may want to change. The defaults should be just
167 fine, unless you have special needs.
168
169 H4: SLAPD_DEFAULT_CONFIGFILE
170
171 This define sets the location of the default slapd configuration file.
172 Normally, it is set to {{EX: $(ETCDIR)/slapd.conf}}, where 
173 {{EX: ETCDIR}} comes from Make-common.
174
175 H4: SLAPD_DEFAULT_SIZELIMIT
176
177 This define sets the default size limit on the number of entries returned
178 from a search. This option is configurable via the tailor file, but if you
179 want to change the default, do it here.
180
181 H4: SLAPD_DEFAULT_TIMELIMIT
182
183 This define sets the default time limit for a search. This option is
184 configurable via the tailor file, but if you want to change the default, do it
185 here.
186
187 H4: SLAPD_PIDFILE
188
189 This define sets the location of the file to which slapd will write its
190 process ID when it starts up.
191
192 H4: SLAPD_ARGSFILE
193
194 This define sets the location of the file to which slapd will write its
195 argument vector when it starts up.
196
197 H4: SLAPD_MONITOR_DN
198
199 This define sets the distinguished name used to retrieve monitoring
200 information from {{I: slapd}}. See section 7 for more details.
201
202 H4: SLAPD_LDBM_MIN_MAXIDS
203
204 This define is only relevant to the LDBM backend. It sets the minimum
205 number of entry IDs that an index entry will contain before it becomes
206 an allIDs entry. See Section 9.1 for more details.
207
208
209
210 H2: Making the Software
211
212 Once you have edited the {{EX: include/ldapconfig.h.edit}} file and the
213 Make-common file (see the top level {{EX: README}} file in the distribution),
214 you are ready to make the software. From the top level LDAP source
215 directory, type
216
217 E: make
218
219 You should examine the output of this command carefully to make sure
220 everything is built correctly. Note that this command builds the LDAP
221 libraries and associated clients as well as slapd and slurpd.
222
223 Note that the LDAP distribution can support making for multiple
224 platforms from a single source tree. If you want to do this, consult the
225 {{EX: INSTALL}} file in the top level distribution directory.
226
227
228
229 H2: Installing the Software
230
231 Once the software has been properly configured and successfully
232 made, you are ready to install it. You will need to have write permission
233 to the installation directories you specified in the {{EX: Make-common}} file.
234 Typically, the installation is done as root. From the top level LDAP
235 source directory, type
236
237 E: make install
238
239 You should examine the output of this command carefully to make sure
240 everything is installed correctly. Slapd, slurpd, and their configuration
241 files, {{EX: slapd.conf}}, {{EX: slapd.at.conf}}, and {{EX: slapd.oc.conf}}
242  will be installed in the {{EX: ETCDIR}} directory you specified 
243 in the {{EX: Make-common}} file.
244
245 This command will install the entire LDAP distribution. If you only want
246 to install slapd and slurpd, you could do something like this:
247
248 E: (cd servers/slapd; make install)
249
250 E: (cd servers/slurpd; make install)
251
252 Note: The installation process installs configuration files as well as
253 binaries. Existing configuration files are first moved to a name with a
254 dash '-' appended, e.g., {{EX: slapd.conf}} is moved to {{EX: slapd.conf-}}. 
255 If you install things twice, however, you can lose your existing configuration
256 files.
257