Monday, January 7, 2013

OpenLDAP Installation


OpenLDAP 2.4 support db version >= 4.4
For details:http://www.openldap.org/doc/admin24/appendix-recommended- versions.html
You have to install db manually from oracle.
Here is my installation procedure. Please change prefix as you wish.

Install Oracle Berkeley DB

installBerkeleyDB.sh
   #!/bin/sh
  
   cd /etc
   rm -rf db-4.7.25*
   wget http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz
   tar zxvf db-4.7.25.tar.gz
   cd db-4.7.25

   cd build_unix/
   ../dist/configure --prefix=/usr/local/db4
   make
   make install

   exit 0

Execute Installation script

      # create shell script file "installBerkeleyDB.sh" from above block
      $sudo nano installBerkeleyDB.sh
        
      # make script executable
      $ sudo chmod -x installBerkeleyDB.sh

      # Fire installation script 
      $ sudo installBerkeleyDB.sh

Note: It is highly recommended to apply the patches from Oracle for a given release.


Install OpenLDAP 2.4 (recommended for N-multi-master clustering )

installOpenLDAP.sh 
  #!/bin/sh

   cd /etc
   rm -rf openldap-2.4.20*
   wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.20.tgz
   tar zxvf openldap-2.4.20.tgz
   cd openldap-2.4.20
   export CPPFLAGS="-I/usr/local/db4/include"
   export LDFLAGS="-L/usr/local/db4/lib -R/usr/local/db4/lib"
   export LD_LIBRARY_PATH=/etc/db-4.7.25/build_unix/.libs
   ./configure
   make
   make depend
   make install

   exit 0

If you are moving from previous version OpenLDAP / Berkley DB to newer version , then there would be conflict error during installation . Make sure previous installation remove before new installation .


Execute Installation script

      # create shell script file "installOpenLDAP.sh" from above block
      $sudo nano installOpenLDAP.sh
        
      # make script executable
      $ sudo chmod -x installOpenLDAP.sh

      # Fire installation script 
      $ sudo installOpenLDAP.sh

No comments:

Post a Comment