1999-10-01 00:57:45 +08:00
# $OpenLDAP$
2000-07-23 02:59:40 +08:00
# Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
1999-04-24 07:41:45 +08:00
# COPYING RESTRICTIONS APPLY, see COPYRIGHT.
1999-04-24 07:00:44 +08:00
H1: Building and Installing slapd & slurpd
2000-08-09 12:28:44 +08:00
Slapd and Slurpd form the heart of OpenLDAP. Slapd is the actual LDAP server
and slurpd provides a data replication system. For the rest of this chapter
we'll just refer to Slapd and Slurpd as OpenLDAP.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
Building and installing OpenLDAP requires several steps: installing
prerequisite software, configuring OpenLDAP itself, making, and finally
installing. The following sections describe this process in detail.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
In case you haven't already obtained OpenLDAP it is available at the following
location: {{URL: ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release.tgz}}
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
The OpenLDAP Project also maintains an extensive site on the World Wide Web.
The site contains the latest OpenLDAP news, release announcements, and
pointers to many other resources. You can access the site at: {{URL: http://www.OpenLDAP.org/}}
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
H2: Prerequisite software
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
In order to use the LDBM backend with OpenLDAP some extra software may
be needed.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
In addition to the database software needed by the LDBM backend, you can
also install several other optional software packages that will add additional
features. See the appendix detailing all of the configuration options for
a complete list of options (and what extra software may be needed.)
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
H3: Database software
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
OpenLDAP's LDBM backend requires a database package to store its data in.
Your operating system may already have this software installed, or you
may need to obtain the software and install it yourself.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
Ether the GNU Project's GDBM or Sleepycat Software's BerkeleyDB
package is recommended. Many UNIX like operating systems already
have one or both of these packages installed.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
GDBM is available from GNU's ftp {{URL: ftp://ftp.gnu.org/pub/gnu/gdbm}}
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
BerkeleyDB is available from Sleepycat's web site {{URL: http://www.sleepycat.com/download.html}}. There are several versions available. Version 3.1 is recommended since Sleepycat has indicated that older versions will not be supported
in the near future.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
Follow the instructions included with the database package for building and
installing the software. Once the database software is installed proceed
to with Configuring OpenLDAP.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
H2: Configuring OpenLDAP
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
If you haven't already done so, untar the distribution and cd to the top:
.{{EX:gunzip -c openldap-VERSION.tgz | tar xf -}}
.{{EX:cd openldap-VERSION}}
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
Now you should probably run the configure script with the --help option.
This will give you a list of options that you can change when building
OpenLDAP. Many of the features of OpenLDAP can be enabled or disabled
using this method. Please see the appendix for a more detailed list
of configure options, and their usage.
.{{EX:./configure --help}}
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
The configure script will also look at certain environment variables
for certain settings. These environment variables are:
!block table
Variable Uses
CC Sets which C Compiler to use (cc,gcc)
CFLAGS What compiler flags to use
CPPFLAGS What C Preprocessor flags to use
LDFLAGS What flags to give the linker
LIBS What libraries to include
!endblock
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
Now run the configure script with any desired configure options or
environment variables.
.{{EX: [env settings] ./configure [options] }}
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
As an example, lets assume that we want a copy of OpenLDAP configured to use the
LDBM backend, and the shell backend. The LDBM backend is turned on by default, so we don't need to do anything special to enable it.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
Additionally, we've installed the BerkeleyDB database package.
Configure is smart enough to use BerkeleyDB automaticly if it can find it, but
BerkeleyDB is installed by default in a place configure won't look at
automaticly. BerkeleyDB is usually installed in /usr/local/BerkeleyDB.3.1
(assuming that version 3.1 is being used.)
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
The following example shows how to run configure and specify where to
find BerkeleyDB and turn on the shell backend. The example should be
entered on a single line (it has been split onto seperate lines for clarity.)
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
If you are using csh (or any shell with similar syntax, ie tcsh.)
.{{EX: env CPPFLAGS="-I/usr/local/BerkeleyDB.3.1/include" LDFLAGS="-L/usr/local/BerkeleyDB.3.1/lib" ./configure --enable-shell}}
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
If you are using sh (or any shell with similar syntax, ie bash,ksh,etc.)
.{{EX: CPPFLAGS="-I/usr/local/BerkeleyDB.3.1/include" LDFLAGS="-L/usr/local/BerkeleyDB.3.1/lib" ./configure --enable-shell}}
1999-05-03 09:19:22 +08:00
2000-08-09 12:28:44 +08:00
For more information on backends see the chapter on configuration.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
The configure script will normally auto-detect appropriate settings.
If you have problems at this stage, consult any platform specific
hints and check your configure options if any.
1999-05-03 09:19:22 +08:00
2000-08-09 12:28:44 +08:00
H2: Building the Software
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
Once you have run the configure script the last line of output should be:
.{{EX:Please "make depend" to build dependencies}}
1999-05-03 09:19:22 +08:00
2000-08-09 12:28:44 +08:00
If the last line of output does not match, configure has probably failed.
You should not proceed until configure completes sucessfuly.
1999-04-24 07:00:44 +08:00
2000-08-09 12:28:44 +08:00
Now run make depend.
.{{EX: make depend}}
1999-05-03 09:19:22 +08:00
2000-08-09 12:28:44 +08:00
Now run make, this step will actually compile OpenLDAP.
.{{EX: make}}
1999-04-24 07:00:44 +08:00
You should examine the output of this command carefully to make sure
everything is built correctly. Note that this command builds the LDAP
libraries and associated clients as well as slapd and slurpd.
2000-08-09 12:28:44 +08:00
Note that the OpenLDAP distribution can support building for multiple
1999-04-24 07:00:44 +08:00
platforms from a single source tree. If you want to do this, consult the
{{EX: INSTALL}} file in the top level distribution directory.
H2: Installing the Software
Once the software has been properly configured and successfully
made, you are ready to install it. You will need to have write permission
2000-08-09 12:28:44 +08:00
to the installation directories you specified when you ran configure.
By default OpenLDAP is installed in /usr/local. If you changed this
setting with the --prefix configure option, it will be installed
in the location you provided.
Typically, the installation is done as root. From the top level OpenLDAP
1999-04-24 07:00:44 +08:00
source directory, type
2000-08-09 12:28:44 +08:00
.{{EX: make install}}
1999-04-24 07:00:44 +08:00
You should examine the output of this command carefully to make sure
2000-08-09 12:28:44 +08:00
everything is installed correctly. You will find the configuration files
for slapd in /usr/local/etc/openldap by default. See chapter 5 for more
information on the configuration files.
1999-04-24 07:00:44 +08:00