July 17, 2012

OpenLDAP 2.4 on CentOS 6.2 Part 1

It is painful when you have errors and somehow you aren't getting way around it.

Here's how I did my Installation:

Downloaded Latest release of OpenLDAP (2.4.31) from here.

Transferred the file to the CentOS 6.2 Server using Secure Copy (SCP). The directory on server can be any with sufficient space in it. I used /home.

The downloaded package was openldap-2.4.31.tgz.
Extract it.


 # tar -xvf openldap-2.4.31.tgz  

This will create a directory /home/openldap-2.4.31
cd to that Directory.

Here you will have some files including the "configure" script.
To check what options the script provides, perform following command


 #./configure --help  

It is always better to let the script decide what options are best for you. We will choose options later as required.


 #./configure

It will start to configure the build.

Here's first error I encountered:

configure: error: Unable to locate cc(1) or suitable replacement.  Check PATH or set CC.

Then I did


 yum install gcc

Which installed development tools, C compiler etc.

The next error, most common:

configure: error: MozNSS not found - please specify the location to the NSPR and NSS header files in CPPFLAGS and the location to the NSPR and NSS libraries in LDFLAGS (if not in the system location)

Location for NSPR and NSS Libraries and Headers varies with Operating System. However, I was unable to find that. I will update soon as soon as I find it.

I tried following option


 #./configure --with-tls=no  

This option bypassed the tls check.

WARNING: Your LDAP Server will then be unable to have TLS Data Protection.

The next error:
configure: error: BDB/HDB: BerkeleyDB not available

This made me download and install BerkeleyDB from here.
To install Berkeley DB see the documentation. I copied it to /home and installed it as follows:


 #tar -xvf db-5.3.21.gz  
 #cd db-5.3.21  
 #make  
 #make install  

Even after installing Berkely DB, it didn't let me proceed with same error. What was missing?
Well I set a few Variables, and I was off.


 CPPFLAGS="-I/usr/local/BerkeleyDB.5.3/include"  
 export CPPFLAGS  
 LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.5.3/lib -R/usr/local/BerkeleyDB.5.3/lib"  
 export LDFLAGS  
 LD_LIBRARY_PATH="/usr/local/BerkeleyDB.5.3/lib"  
 export LD_LIBRARY_PATH  

Make sure you put a capital "I" instead of "i" in CPPFLAGS or it may throw following error:


configure:5251: error: C compiler cannot create executables
See `config.log' for more details.

Then the harsh configure was done.
Next command, Run "make depend", then "make", then "make test" and last "make install"!

Continuing in Part 2, the configuration after installing OpenLDAP.

Labels: , , ,

2 Comments:

At January 16, 2013 at 4:34 AM , Anonymous Anonymous said...

It's far easy to install open-ldap package through 'yum' or RPM. Package managers are convenient way to install/remove packages on the system.

 
At February 27, 2014 at 12:53 PM , Blogger bhuvnesh singh said...

thank you brohter

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home