当前位置: 技术问答>linux和unix
菜鸟:LDAP如何安装??
来源: 互联网 发布时间:2015-03-11
本文导语: 2. Type: % ./configure --help to list available configuration options. A description of these options is provided in the 'CONFIGURE OPTIONS' section below. The configure script uses environmental variable...
2. Type:
% ./configure --help
to list available configuration options. A description of these
options is provided in the 'CONFIGURE OPTIONS' section below.
The configure script uses environmental variables for determining
compiler/linker options including:
Variable Description Example
CC C compiler gcc
CFLAGS C flags -O -g
CPPFLAGS cpp flags -I/path/include -Ddef
LDFLAGS ld flags -L/usr/local/lib
LIBS libraries -llib
PATH command path /usr/local/bin:/usr/bin:/bin
3. Configure the build system
% [env settings] ./configure [options]
If all goes well, the configure script with automatically detect
the appropriate settings. However, you may need to specify
options and/or environment variables to obtain desired results.
======================
第二步不知道如何做。
第三步的时候出现如下错误。
.....
checking for pthread link with -lpthreads -lmach -lexc -lc_r... no
checking for pthread link with -lpthreads -lmach -lexc... no
checking for pthread link with -lpthreads -lexc... no
checking for pthread link with -lpthreads... no
configure: error: could not link with POSIX Threads
% ./configure --help
to list available configuration options. A description of these
options is provided in the 'CONFIGURE OPTIONS' section below.
The configure script uses environmental variables for determining
compiler/linker options including:
Variable Description Example
CC C compiler gcc
CFLAGS C flags -O -g
CPPFLAGS cpp flags -I/path/include -Ddef
LDFLAGS ld flags -L/usr/local/lib
LIBS libraries -llib
PATH command path /usr/local/bin:/usr/bin:/bin
3. Configure the build system
% [env settings] ./configure [options]
If all goes well, the configure script with automatically detect
the appropriate settings. However, you may need to specify
options and/or environment variables to obtain desired results.
======================
第二步不知道如何做。
第三步的时候出现如下错误。
.....
checking for pthread link with -lpthreads -lmach -lexc -lc_r... no
checking for pthread link with -lpthreads -lmach -lexc... no
checking for pthread link with -lpthreads -lexc... no
checking for pthread link with -lpthreads... no
configure: error: could not link with POSIX Threads
|
我前几天在redhat linux 8.0下刚安装了openldap v2.1
我是按照其官方网站(www.openldap.org)上的文档进行安装的。
我分别用系统默认的安装和定制安装各安装一次,均成功。
下面是其快速启动向导:
Get the software
http://www.openldap.org/software/download/
Unpack the distribution
gunzip -c openldap-VERSION.tgz | tar xvfB - then relocate yourself into
the distribution directory:
cd openldap-VERSION
Run 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 --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
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.
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.
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).
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:
database bdb
suffix "dc=,dc="
rootdn "cn=Manager,dc=,dc="
rootpw secret
directory /usr/local/var/openldap-data
Be sure to replace and with the appropriate domain components of your domain name. For example, for example.com, use:
database bdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
rootpw secret
directory /usr/local/var/openldap-data
If your domain contains additional components, such as eng.uni.edu.eu, use:
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: the directory specified must exist prior to starting slapd(8).
--------------------------------------------------------------------------------
Start SLAPD.
You are now ready to start the stand-alone LDAP server, slapd(8), by running the command:
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 -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:
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.
Add initial entries to your directory.
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
run ldapadd
Use your favorite editor and create an LDIF file that contains:
dn: dc=,dc=
objectclass: dcObject
objectclass: organization
o:
dc:
dn: cn=Manager,dc=,dc=
objectclass: organizationalRole
cn: Manager
Be sure to replace and with the appropriate domain components of your domain name. 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.
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=,dc=" -W -f example.ldif
Be sure to replace and 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:
ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f example.ldif
where example.ldif is the file you created above.
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:
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).
我是按照其官方网站(www.openldap.org)上的文档进行安装的。
我分别用系统默认的安装和定制安装各安装一次,均成功。
下面是其快速启动向导:
Get the software
http://www.openldap.org/software/download/
Unpack the distribution
gunzip -c openldap-VERSION.tgz | tar xvfB - then relocate yourself into
the distribution directory:
cd openldap-VERSION
Run 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 --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
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.
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.
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).
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:
database bdb
suffix "dc=,dc="
rootdn "cn=Manager,dc=,dc="
rootpw secret
directory /usr/local/var/openldap-data
Be sure to replace and with the appropriate domain components of your domain name. For example, for example.com, use:
database bdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
rootpw secret
directory /usr/local/var/openldap-data
If your domain contains additional components, such as eng.uni.edu.eu, use:
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: the directory specified must exist prior to starting slapd(8).
--------------------------------------------------------------------------------
Start SLAPD.
You are now ready to start the stand-alone LDAP server, slapd(8), by running the command:
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 -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:
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.
Add initial entries to your directory.
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
run ldapadd
Use your favorite editor and create an LDIF file that contains:
dn: dc=,dc=
objectclass: dcObject
objectclass: organization
o:
dc:
dn: cn=Manager,dc=,dc=
objectclass: organizationalRole
cn: Manager
Be sure to replace and with the appropriate domain components of your domain name. 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.
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=,dc=" -W -f example.ldif
Be sure to replace and 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:
ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f example.ldif
where example.ldif is the file you created above.
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:
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).
|
应该是
#./configure
#mike
#mike install
吧
#./configure
#mike
#mike install
吧
|
./configure --enable-bdb
|
上次我看的GOOGLE上找到的一篇帖子说是你LDAP的版本不对,不知道是不是.
关注一下
关注一下