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