日期:2014-05-16  浏览次数:20613 次

LDAP Redhat Enterprise Linux安装
Share

We all respect Redhat's goal of providing a stable operating system to its customers, the stability often comes at price. Often in the form of missing features that are available in the more recent releases of many packages. One such product has always been OpenLDAP. There are many LDAP implementations available today, including 389 Directory Server, which is a good enterprise directory server, but often includes too much extra stuff that is not needed. I have always preferred OpenLDAP for its simplicity, no frills, get the job done directory server. The latest version of OpenLDAP adds some very nice enterprise features such as multi-master replication and a new LDAP based configuration, which, I admit, I am still getting used too in comparison to good old fashioned slapd.conf file. In this article I am going to go through how I installed OpdenLDAP 2.4.x on Redhat Enterprise Linux. These same instructions are applicable to CentOS users as well.

  1. In order to install openldap, you need to install some prerequisites.

    yum install cyrus-sasl-devel openssl-devel krb5-devel zlib-devel
  2. Next we need to install Berkely-DB. This software package can be obtained via the following link: http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html .
  3. Download the software package and extract the contents to your system where you will be installing OpenLDAP. In this case I have download the following file: db-5.1.25.tar.gz.

    tar -zxvf db-5.1.25.tar.gz
  4. Next change into the newly created directory.

    cd db-5.1.25
    cd build_unix

  5. Configure the package. You will note that I am installing everything into /opt/local. That is where I put random things like this. You could also consider putting everyting in /usr/local, which makes your life easier in some ways.

    ../dist/configure --prefix=/opt/local
  6. Run make

    make
  7. Now install the software

    sudo make install
  8. Now that berkely-db is built, we can begin the OpenLDAP installation. First download the installation files

    wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.24.tgz
  9. Extract the tarball

    tar -zxvf openldap-2.4.24.tgz
  10. Change into the installation directory

    cd openldap-2.4.24
  11. Configure the software. You can specify the options you want for your installation. These are the ones I am using. Also make note of how I am passing the build flags via the command. This is very important otherwise the configure script will complain about your version of berkely-db header.

    env CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" ./configure --enable-hdb --enable-bdb --enable-overlays=mod --prefix=/opt/local
  12. Compile the software

    make
  13. Install the software

    make install
  14. Now you have installed OpenLDAP, there are a couple of problems though. First of all /opt/local/lib is not in your library path. This can of course be remediated in a couple of ways. Install everything into /usr/local which is recognized as a valid library path or we can make a few tweaks to the ld.so.conf.d directory.

    vim /etc/ld.so.conf.d/ldap.conf