1999-10-01 00:57:45 +08:00
|
|
|
# $OpenLDAP$
|
2001-05-18 10:45:46 +08:00
|
|
|
# Copyright 1999-2001, 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
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
H1: A Quick-Start Guide
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2001-01-18 10:19:00 +08:00
|
|
|
The following is a quick start guide to OpenLDAP 2.1 software,
|
2000-08-11 16:17:34 +08:00
|
|
|
including the stand-alone LDAP daemon, {{slapd}}(8).
|
2000-07-30 23:20:14 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
It is meant to step you through the basic steps needed to install
|
|
|
|
and configure OpenLDAP software. It should be used in conjunction
|
|
|
|
with the other chapters of this document, manual pages, and
|
|
|
|
other materials provided with the distribution (e.g. the {{F:INSTALL}}
|
|
|
|
document) or on the OpenLDAP web site (in particular, the
|
|
|
|
OpenLDAP Software FAQ).
|
2000-07-30 23:20:14 +08:00
|
|
|
|
2002-04-20 14:18:55 +08:00
|
|
|
If you intend to run OpenLDAP seriously, you should review all
|
|
|
|
of this document before attempting to install the software.
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2001-05-18 10:45:46 +08:00
|
|
|
Note: This quick start guide does not use strong authentication
|
|
|
|
nor any integrity or confidential protection services. These
|
|
|
|
services are described in other chapters of the OpenLDAP Administrator's
|
|
|
|
Guide.
|
1999-04-24 07:00:44 +08:00
|
|
|
|
1999-05-03 09:19:22 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
.{{S: }}
|
|
|
|
^{{B: Get the software}}
|
|
|
|
|
|
|
|
. You can obtain a copy of the software by following the
|
|
|
|
instructions on the OpenLDAP download
|
|
|
|
page ({{URL: http://www.openldap.org/software/download/}}).
|
2000-10-04 03:27:56 +08:00
|
|
|
It is recommended that new users start with the (latest)
|
|
|
|
{{release}}.
|
2000-08-11 16:17:34 +08:00
|
|
|
|
1999-05-03 09:19:22 +08:00
|
|
|
|
2000-07-23 15:35:40 +08:00
|
|
|
.{{S: }}
|
2000-08-11 16:17:34 +08:00
|
|
|
+{{B: Unpack the distribution}}
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
.Pick a directory for the LDAP source to live under, change
|
|
|
|
directory to there, and unpack the distribution using the
|
|
|
|
following commands:
|
1999-05-03 09:19:22 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:gunzip -c openldap-VERSION.tgz | tar xvfB -}}
|
1999-05-03 09:19:22 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. then relocate yourself into the distribution directory:
|
|
|
|
|
2000-08-25 05:38:00 +08:00
|
|
|
..{{EX:cd openldap-VERSION}}
|
2000-08-11 16:17:34 +08:00
|
|
|
|
|
|
|
. You'll have to replace {{F:VERSION}} with the version
|
2000-07-23 04:55:47 +08:00
|
|
|
name of the release.
|
|
|
|
|
|
|
|
|
2000-07-23 15:35:40 +08:00
|
|
|
.{{S: }}
|
2000-09-10 07:16:09 +08:00
|
|
|
+{{B: Review documentation}}
|
2000-07-23 04:55:47 +08:00
|
|
|
|
2000-09-10 07:16:09 +08:00
|
|
|
. You should now review the {{F:COPYRIGHT}}, {{F:LICENSE}},
|
|
|
|
{{F:README}} and {{F:INSTALL}} documents provided with the distribution.
|
2000-08-11 16:17:34 +08:00
|
|
|
The {{F:COPYRIGHT}} and {{F:LICENSE}} provide information on
|
|
|
|
acceptable use, copying, and limitation of warranty of OpenLDAP
|
2000-09-10 07:16:09 +08:00
|
|
|
software.
|
|
|
|
|
|
|
|
.{{S: }}
|
|
|
|
. You should also review other chapters of this document.
|
|
|
|
In particular, the {{SECT:Building and Installing OpenLDAP Software}}
|
|
|
|
chapter of this document provides detailed information on prerequisite
|
|
|
|
software and installation procedures.
|
1999-05-03 09:19:22 +08:00
|
|
|
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
.{{S: }}
|
|
|
|
+{{B: Run {{EX:configure}}}}
|
|
|
|
|
|
|
|
. You will need to run the provided {{EX:configure}} script to
|
|
|
|
{{configure}} to the distribution for building on your system. The
|
2000-08-30 13:05:26 +08:00
|
|
|
{{EX:configure}} script accepts many command line options that enable or
|
2000-08-11 16:17:34 +08:00
|
|
|
disable optional software features. Usually the defaults are okay,
|
2000-07-30 23:20:14 +08:00
|
|
|
but you may want to change them. To get a complete list of options
|
2000-08-11 16:17:34 +08:00
|
|
|
that {{EX:configure}} accepts, use the {{EX:--help}} option:
|
1999-05-03 09:19:22 +08:00
|
|
|
|
2000-07-23 03:23:03 +08:00
|
|
|
..{{EX:./configure --help}}
|
1999-05-03 09:19:22 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. However, given that you using this guide, we'll assume you'll
|
|
|
|
are brave enough to just let {{EX:configure}} to determine
|
|
|
|
what's best:
|
|
|
|
|
|
|
|
..{{EX:./configure}}
|
|
|
|
|
|
|
|
. Assuming {{EX:configure}} doesn't dislike your system, you can
|
|
|
|
proceed with building the software. If {{EX:configure}} did
|
|
|
|
complain, well, you'll likely need to go to the FAQ Installation
|
|
|
|
Section ({{URL:http://www.openldap.org/faq/}} and/or actually
|
2000-08-14 03:48:56 +08:00
|
|
|
read the {{SECT:Building and Installing OpenLDAP Software}}
|
2000-08-11 16:17:34 +08:00
|
|
|
chapter of this document.
|
|
|
|
|
|
|
|
|
|
|
|
.{{S: }}
|
|
|
|
+{{B:Build the software}}.
|
|
|
|
|
|
|
|
. The next step is to build the software. This step has two
|
|
|
|
parts, first we construct dependencies and then we compile the
|
|
|
|
software:
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2000-07-23 03:23:03 +08:00
|
|
|
..{{EX:make depend}}
|
|
|
|
..{{EX:make}}
|
1999-04-24 07:00:44 +08:00
|
|
|
|
1999-05-03 09:19:22 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. Both makes should complete without error.
|
1999-05-03 09:19:22 +08:00
|
|
|
|
2000-07-23 15:35:40 +08:00
|
|
|
|
|
|
|
.{{S: }}
|
2000-08-11 16:17:34 +08:00
|
|
|
+{{B:Test the build}}.
|
|
|
|
|
|
|
|
. To ensure a correct build, you should run the test suite
|
|
|
|
(it only takes a few minutes):
|
|
|
|
|
|
|
|
..{{EX:make test}}
|
|
|
|
|
|
|
|
. Tests which apply to your configuration will run and they
|
|
|
|
should pass. Some tests, such as the replication test, may
|
|
|
|
be skipped.
|
|
|
|
|
2000-07-23 04:55:47 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
.{{S: }}
|
|
|
|
+{{B:Install the software}}.
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. You are now ready to install the software, this usually requires
|
|
|
|
{{super-user}} privledges:
|
1999-05-03 09:19:22 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:su root -c 'make install'}}
|
2000-07-20 07:12:15 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. Everything should now be installed under {{F:/usr/local}} (or
|
2002-04-20 14:33:22 +08:00
|
|
|
whatever installation prefix was used by {{EX:configure}}).
|
2000-07-20 07:12:15 +08:00
|
|
|
|
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
.{{S: }}
|
|
|
|
+{{B:Edit the configuration file}}.
|
2000-07-23 04:55:47 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. Use your favorite editor to edit the provided {{slapd.conf}}(5)
|
2000-08-25 05:38:00 +08:00
|
|
|
example (usually installed as {{F:/usr/local/etc/openldap/slapd.conf}})
|
|
|
|
to contain an LDBM database definition of the form:
|
2000-07-20 07:12:15 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:database ldbm}}
|
2000-10-24 03:00:05 +08:00
|
|
|
..{{EX:suffix "dc=<MY-DOMAIN>,dc=<COM>"}}
|
|
|
|
..{{EX:rootdn "cn=Manager,dc=<MY-DOMAIN>,dc=<COM>"}}
|
2000-07-23 03:23:03 +08:00
|
|
|
..{{EX:rootpw secret}}
|
|
|
|
..{{EX:directory /usr/local/var/openldap-ldbm}}
|
2000-07-20 07:12:15 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. Be sure to replace {{EX:<MY-DOMAIN>}} and {{EX:<COM>}} with
|
|
|
|
the appropriate domain components of your domain name. For
|
|
|
|
example, for {{EX:example.com}}, use:
|
2000-07-20 07:12:15 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:database ldbm}}
|
2000-10-24 03:00:05 +08:00
|
|
|
..{{EX:suffix "dc=example,dc=com"}}
|
|
|
|
..{{EX:rootdn "cn=Manager,dc=example,dc=com"}}
|
2000-07-23 03:23:03 +08:00
|
|
|
..{{EX:rootpw secret}}
|
|
|
|
..{{EX:directory /usr/local/var/openldap-ldbm}}
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
.If your domain contains additional components, such as
|
|
|
|
{{EX:eng.uni.edu.eu}}, use:
|
2000-07-23 04:55:47 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:database ldbm}}
|
2000-10-24 03:00:05 +08:00
|
|
|
..{{EX:suffix "dc=eng,dc=uni,dc=edu,dc=eu"}}
|
|
|
|
..{{EX:rootdn "cn=Manager,dc=eng,dc=uni,dc=edu,dc=eu"}}
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:rootpw secret}}
|
|
|
|
..{{EX:directory /usr/local/var/openldap-ldbm}}
|
|
|
|
|
|
|
|
. Details regarding configuring {{slapd}}(8) can be found
|
|
|
|
in the {{slapd.conf}}(5) manual page and the
|
|
|
|
{{SECT:The slapd Configuration File}} chapter of this
|
|
|
|
document.
|
2000-07-23 15:35:40 +08:00
|
|
|
|
|
|
|
.{{S: }}
|
2000-08-11 16:17:34 +08:00
|
|
|
+{{B:Start SLAPD}}.
|
|
|
|
|
|
|
|
. You are now ready to start the stand-alone LDAP server, slapd(8),
|
|
|
|
by running the command:
|
2000-07-23 04:55:47 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:su root -c /usr/local/libexec/slapd}}
|
2000-07-23 04:55:47 +08:00
|
|
|
|
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. To check to see if the server is running and configured correctly,
|
2000-08-30 13:05:26 +08:00
|
|
|
you can run a search against it with {{ldapsearch}}(1). By default,
|
|
|
|
ldapsearch is installed as {{F:/usr/local/bin/ldapsearch}}:
|
2000-07-23 04:55:47 +08:00
|
|
|
|
|
|
|
..{{EX:ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts}}
|
|
|
|
|
2000-07-30 23:20:14 +08:00
|
|
|
. Note the use of single quotes around command parameters to prevent
|
2000-08-30 13:05:26 +08:00
|
|
|
special characters from being interpreted by the shell. This should return:
|
2000-07-23 04:55:47 +08:00
|
|
|
|
|
|
|
..{{EX:dn:}}
|
2000-10-24 03:00:05 +08:00
|
|
|
..{{EX:namingContexts: dc=example,dc=com}}
|
2000-08-11 16:17:34 +08:00
|
|
|
|
|
|
|
. Details regarding running {{slapd}}(8) can be found
|
|
|
|
in the {{slapd}}(8) manual page and the
|
|
|
|
{{SECT:Running slapd}} chapter of this document.
|
2000-07-23 04:55:47 +08:00
|
|
|
|
2000-07-23 15:35:40 +08:00
|
|
|
|
|
|
|
.{{S: }}
|
2000-08-11 16:17:34 +08:00
|
|
|
+{{B:Add initial entries to your directory}}.
|
|
|
|
|
|
|
|
. You can use {{ldapadd}}(1) to add entries to your LDAP directory.
|
2000-08-30 13:05:26 +08:00
|
|
|
{{ldapadd}} expects input in LDIF form. We'll do it in two steps:
|
2000-08-11 16:17:34 +08:00
|
|
|
|
2000-08-30 13:05:26 +08:00
|
|
|
^^ create an LDIF file
|
2000-08-11 16:17:34 +08:00
|
|
|
++ run ldapadd
|
2000-07-23 04:55:47 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. Use your favorite editor and create an LDIF file that contains:
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2000-10-24 03:00:05 +08:00
|
|
|
..{{EX:dn: dc=<MY-DOMAIN>,dc=<COM>}}
|
2000-07-23 03:23:03 +08:00
|
|
|
..{{EX:objectclass: dcObject}}
|
|
|
|
..{{EX:objectclass: organization}}
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:o: <MY ORGANIZATION>}}
|
|
|
|
..{{EX:dc: <MY-DOMAIN>}}
|
2000-09-15 00:40:12 +08:00
|
|
|
..{{EX:}}
|
2000-10-24 03:00:05 +08:00
|
|
|
..{{EX:dn: cn=Manager,dc=<MY-DOMAIN>,dc=<COM>}}
|
2000-09-10 07:16:09 +08:00
|
|
|
..{{EX:objectclass: organizationalRole}}
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:cn: Manager}}
|
|
|
|
|
2002-04-20 14:33:22 +08:00
|
|
|
. Be sure to replace {{EX:<MY-DOMAIN>}} and {{EX:<COM>}} with the appropriate domain
|
|
|
|
components of your domain name. {{EX:<MY ORGANIZATION>}} should be replaced
|
2000-09-15 00:40:12 +08:00
|
|
|
with the name of your organization. If you cut and paste, be sure
|
|
|
|
to trim any leading and trailing whitespace from the example.
|
2000-08-11 16:17:34 +08:00
|
|
|
|
2000-10-24 03:00:05 +08:00
|
|
|
..{{EX:dn: dc=example,dc=com}}
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:objectclass: dcObject}}
|
|
|
|
..{{EX:objectclass: organization}}
|
|
|
|
..{{EX:o: Example Company}}
|
2000-07-23 03:23:03 +08:00
|
|
|
..{{EX:dc: example}}
|
2000-09-15 00:40:12 +08:00
|
|
|
..{{EX:}}
|
2000-10-24 03:00:05 +08:00
|
|
|
..{{EX:dn: cn=Manager,dc=example,dc=com}}
|
2000-09-10 07:16:09 +08:00
|
|
|
..{{EX:objectclass: organizationalRole}}
|
|
|
|
..{{EX:cn: Manager}}
|
2000-07-20 07:12:15 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. Now, you may run {{ldapadd}}(1) to insert these entries into
|
|
|
|
your directory.
|
2000-07-20 07:22:34 +08:00
|
|
|
|
2000-10-31 12:06:02 +08:00
|
|
|
..{{EX:ldapadd -x -D "cn=Manager,dc=<MY-DOMAIN>,dc=<COM>" -W -f example.ldif}}
|
2000-07-20 07:22:34 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. Be sure to replace {{EX:<MY-DOMAIN>}} and {{EX:<COM>}} with the
|
|
|
|
appropriate domain components of your domain name. You will be
|
|
|
|
prompted for the "{{EX:secret}}" specified in {{F:slapd.conf}}.
|
|
|
|
For example, for {{EX:example.com}}, use:
|
2000-07-20 07:22:34 +08:00
|
|
|
|
2000-10-24 03:00:05 +08:00
|
|
|
..{{EX:ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f example.ldif}}
|
2000-07-30 23:20:14 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. where {{F:example.ldif}} is the file you created above.
|
|
|
|
..{{EX: }}
|
|
|
|
. Additional informaton regarding directory creation can be found
|
|
|
|
in the {{SECT:Database Creation and Maintenance Tools}} chapter of
|
|
|
|
this document.
|
2000-07-30 23:20:14 +08:00
|
|
|
|
2000-07-23 15:35:40 +08:00
|
|
|
.{{S: }}
|
2000-07-23 04:55:47 +08:00
|
|
|
+{{B:See if it works}}.
|
2000-07-20 07:12:15 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. Now we're ready to verify the added entries are in your directory.
|
2000-07-23 04:55:47 +08:00
|
|
|
You can use any LDAP client to do this, but our example uses the
|
2000-08-11 16:17:34 +08:00
|
|
|
{{ldapsearch}}(1) tool. Remember to replace {{EX:dc=example,dc=com}}
|
|
|
|
with the correct values for your site:
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
..{{EX:ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'}}
|
1999-04-24 07:00:44 +08:00
|
|
|
|
2000-08-11 16:17:34 +08:00
|
|
|
. This command will search for and retrieve every entry in the database.
|
2000-07-23 04:55:47 +08:00
|
|
|
|
2000-07-30 23:20:14 +08:00
|
|
|
You are now ready to add more entries using {{ldapadd}}(1) or
|
2000-07-23 04:55:47 +08:00
|
|
|
another LDAP client, experiment with various configuration options,
|
2000-08-11 16:17:34 +08:00
|
|
|
backend arrangements, etc.
|
|
|
|
|
|
|
|
Note that by default, the {{slapd}}(8) database grants {{read access
|
|
|
|
to everybody}} excepting the {{super-user}} (as specified by the
|
2001-05-18 10:45:46 +08:00
|
|
|
{{EX:rootdn}} configuration directive). It is highly recommended
|
|
|
|
that you establish controls to restrict access to authorized users.
|
|
|
|
Access controls are discussed in the {{SECT:Access Control}} section
|
|
|
|
of the {{SECT:The slapd Configuration File}} chapter. You are also
|
|
|
|
encouraged to read {{SECT:Security Considerations}}, {{SECT:Using
|
|
|
|
SASL}} and {{SECT:Using TLS}} sections.
|
2000-07-30 23:20:14 +08:00
|
|
|
|
|
|
|
The following chapters provide more detailed information on making,
|
|
|
|
installing, and running {{slapd}}(8).
|