256人阅读 评论(0)

A Quick-Start Guide（快速入门指南）

The following is a quick start guide to OpenLDAP Software 2.3, including the stand-alone LDAP daemon, slapd(8).

It is meant to walk 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 INSTALL document) or on the OpenLDAP web site (in particular, the OpenLDAP Software FAQ).

If you intend to run OpenLDAP Software seriously, you should review all of this document before attempting to install the software.

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.

• Unpack the distribution（解压发行包）
• Pick a directory for the source to live under, change directory to there, and unpack the distribution using the following commands:
选择原程序存放目录，将该目录改成当前目录，并且使用下列命令解压发行版：
gunzip -c openldap-VERSION.tgz | tar xvfB -

• then relocate yourself into the distribution directory:
然后重新使您进入发行版目录：
cd openldap-VERSION

• You'll have to replace VERSION with the version name of the release.
您必须用发行版本号来替换 VERSION。
• Review documentation（查看文档）
• You should now review the COPYRIGHT, LICENSE, README and INSTALL documents provided with the distribution. The COPYRIGHT and LICENSE provide information on acceptable use, copying, and limitation of warranty of OpenLDAP software.
• You should also review other chapters of this document. In particular, the Building and Installing OpenLDAP Software chapter of this document provides detailed information on prerequisite software and installation procedures.
您也应该看看本文档的其他章节。特别是本文档的编译和安装 OpenLDAP 软件章节提供了所需软件及安装步骤的详细信息。
• Run configure（运行 configure 脚本）
• You will need to run the provided configure script to configure the distribution for building on your system. The configure script accepts many command line options that enable or disable optional software features. Usually the defaults are okay, but you may want to change them. To get a complete list of options that configure accepts, use the --help option:
在您系统编译之前您需要运行系统提供 configure 脚本来配置您的发行版。configure 脚本接受许多命令行选项，它们允许或禁用软件的某些可选特性。通常情况下，默认的选项就可以的，但您也许需要改变它们。要得到 configure 脚本接受的命令行参数的列表，使用—-help选项：
./configure --help

• However, given that you are using this guide, we'll assume you are brave enough to just let configure determine what's best:
然而，既然您使用了本指南，我们将假设您有足够的勇气来让 configure 决定什么是最好的：
./configure

• Assuming configure doesn't dislike your system, you can proceed with building the software. If configure did complain, well, you'll likely need to go to the FAQ Installation Section (http://www.openldap.org/faq/ and/or actually read the Building and Installing OpenLDAP Software chapter of this document.
假设 configure 并不讨厌您的系统，您将可以继续编译软件。如果 configure 在抱怨，那么好吧，现在您需要查看 FAQ 的安装部分（ http://www.openldap.org/faq/ ），并且／或者阅读本文档的“编译和安装 OpenLDAP 软件”部分。
• 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:
下一步就是编译软件。这一步分两部分，首先，我们创建编译依赖选项，然后再编译软件：
make depend
make

• Both makes should complete without error.
两次 make 都应该没有错误。
• Test the build.（测试编译）
• To ensure a correct build, you should run the test suite (it only takes a few minutes):
为了确保能正确编译，您应该运行测试套件（它只需要花几分钟时间）：
make test

• Tests which apply to your configuration will run and they should pass. Some tests, such as the replication test, may be skipped.
适用您配置的测试将会运行且应该通过。而有些测试，如复制测试，就可以忽略了。
• Install the software.（安装软件）
• You are now ready to install the software; this usually requires super-user privileges:
您现在可以准备安装软件了。这通常需要超级用户的权限：
su root -c 'make install'

• Everything should now be installed under /usr/local (or whatever installation prefix was used by configure).
现在所有东西都应该被安装到 /usr/local 中（或是 configure 时所指定的安装目录）
• Edit the configuration file.（编辑配置文件）
• Use your favorite editor to edit the provided slapd.conf(5) example (usually installed as /usr/local/etc/openldap/slapd.conf) to contain a BDB database definition of the form:
使用您喜爱的编辑器来编辑系统提供的 slapd.conf（5）示例（通常安装在/usr/local/etc/openldap/slapd.conf ）用以包含一个如下所示的 BDB 数据库定义：
database bdb
suffix "dc=<MY-DOMAIN>,dc=<COM>"
rootdn "cn=Manager,dc=<MY-DOMAIN>,dc=<COM>"
rootpw secret
directory /usr/local/var/openldap-data

• Be sure to replace <MY-DOMAIN> and <COM> with the appropriate domain components of your domain name. For example, for example.com, use:
请确保记住使用正确的域名替换 <MY-DOMAIN> 和 <COM>。如对于 example.com，可用：
database bdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
rootpw secret
directory /usr/local/var/openldap-data

如果您的域名包含了其他的部分，如 eng.uni.edu.eu，那么则用：
database bdb
suffix "dc=eng,dc=uni,dc=edu,dc=eu"
rootdn "cn=Manager,dc=eng,dc=uni,dc=edu,dc=eu"
rootpw secret
directory /usr/local/var/openldap-data

• Details regarding configuring slapd(8) can be found in the slapd.conf(5) manual page and the The slapd Configuration File chapter of this document. Note that the specified directory must exist prior to starting slapd(8).
配置 slapd(8) 的相关细节可以在 slapd.conf(5) 的手册页中以及在本文档的“slapd 配置文件”一章中找到。注意在启动 slapd 之前指定的目录必须已经存在。
• Start SLAPD.（启动 SLAPD）
• You are now ready to start the stand-alone LDAP server, slapd(8), by running the command:
您现在已经为启动独立的 LDAP 服务器，slapd(8) 做好准备了。运行命令：
su root -c /usr/local/libexec/slapd

• To check to see if the server is running and configured correctly, you can run a search against it with ldapsearch(1). By default, ldapsearch is installed as /usr/local/bin/ldapsearch:
要检查服务是否正在运行并且配置正确，您可以使用 ldapsearch(1) 来对服务器执行一个搜索。缺省情况下，ldapsearch 安装在 /usr/local/bin/ldapsearch ：
ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts

• Note the use of single quotes around command parameters to prevent special characters from being interpreted by the shell. This should return:
请注意命令行参数中单引号的使用，它们阻止特殊的字符被shell解析。这里应该返回：
dn:
namingContexts: dc=example,dc=com

• Details regarding running slapd(8) can be found in the slapd(8) manual page and the Running slapd chapter of this document.
运行 slapd(8) 的相关细节可以在 slapd(8) 的手册页或者本文档的“运行 SLAPD”章节中找到。
• You can use ldapadd(1) to add entries to your LDAP directory. ldapadd expects input in LDIF form. We'll do it in two steps:
• create an LDIF file （创建一个 LDIF 文件）
• Use your favorite editor and create an LDIF file that contains:
使用您喜爱的编辑器来创建一个 LDIF 文件，其内容如下：
dn: dc=<MY-DOMAIN>,dc=<COM>
objectclass: dcObject
objectclass: organization
o: <MY ORGANIZATION>
dc: <MY-DOMAIN>

dn: cn=Manager,dc=<MY-DOMAIN>,dc=<COM>
objectclass: organizationalRole
cn: Manager

• Be sure to replace <MY-DOMAIN> and <COM> with the appropriate domain components of your domain name. <MY ORGANIZATION> should be replaced with the name of your organization. When you cut and paste, be sure to trim any leading and trailing whitespace from the example.
确保使用正确的域名部分来替换 <MY-DOMAIN> 和 <COM>，并使用您组织的名称来替换 <MY ORGANIZATION>。如果您使用拷贝和粘贴，请确保将开始和结束处的空格从下面的例子中去掉。
dn: dc=example,dc=com
objectclass: dcObject
objectclass: organization
o: Example Company
dc: example

dn: cn=Manager,dc=example,dc=com
objectclass: organizationalRole
cn: Manager

• Now, you may run ldapadd(1) to insert these entries into your directory.
ldapadd -x -D "cn=Manager,dc=<MY-DOMAIN>,dc=<COM>" -W -f example.ldif

• Be sure to replace <MY-DOMAIN> and <COM> with the appropriate domain components of your domain name. You will be prompted for the "secret" specified in slapd.conf. For example, for example.com, use:
确保使用正确的域名部分来替换 <MY-DOMAIN> 和 <COM>，您将会被提示输入 slapd.conf 中指定的“secret”部分）：
ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f example.ldif

• where example.ldif is the file you created above.
其中，example.ldif 是上面您创建的文件。
• Additional information regarding directory creation can be found in the Database Creation and Maintenance Tools chapter of this document.
创建目录的其它相关信息可以在本文档的“数据库创建和维护工具”一章中找到。
• See if it works.（查看它是否正常工作）
• Now we're ready to verify the added entries are in your directory. You can use any LDAP client to do this, but our example uses the ldapsearch(1) tool. Remember to replace dc=example,dc=com with the correct values for your site:
现在我们来准备确认新增的条目确实在数据库中。您可以使用任何 LDAP 客户端来验证这一点。不过我们的例子是使用 ldapsearch(1) 工具。记住，使用您站点的正确值来替换 dc=example,dc=com ：
ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'

• This command will search for and retrieve every entry in the database.
这个命令将搜索并获得数据库中的所有条目。

You are now ready to add more entries using ldapadd(1) or another LDAP client, experiment with various configuration options, backend arrangements, etc..

Note that by default, the slapd(8) database grants read access to everybody excepting the super-user (as specified by the rootdn configuration directive). It is highly recommended that you establish controls to restrict access to authorized users. Access controls are discussed in the Access Control section of The slapd Configuration File chapter. You are also encouraged to read the Security Considerations, Using SASL and Using TLS sections.

The following chapters provide more detailed information on making, installing, and running slapd(8).

0
0

* 以上用户言论只代表其个人观点，不代表CSDN网站的观点或立场
个人资料
• 访问：7414次
• 积分：204
• 等级：
• 排名：千里之外
• 原创：15篇
• 转载：1篇
• 译文：0篇
• 评论：0条
阅读排行
评论排行