First we need to install the openldap rpms:
WHM>Software>Install RPM
- installed openldap
- installed openldap-servers
- installed openldap-devel - if it is not installed, you'll get "Cannot find ldap.h" error while recompiling - this also needs cyrus-sasl-devel installed
(If cyrus-sasl-devel won't install - find your existing version and download it from the centos mirror
- installed openldap-clients - for working from command line
if you are using php5, add the following in /var/cpanel/easy/apache/rawopts/all_php5
--with-ldap=/usr
See this page for more info http://www.cpanel.net/support/docs/ea/ea3/ea3custom_flags.html - see that page for php4 support.
Then run
- Code: Select all
/scripts/easyapache
It will then build apache/php and include ldap support for php.
Create a phpinfo page and you will see ldap listed there now.
########################################
If 'tmp' is mounted with noexec permissions --> when OpenLDAP runs, script gets created in /tmp which needed executing.
One possible solution to the specific issue in the ldap script is to move the script from /tmp to /var/tmp. Specifically, in the /etc/init.d/ldap file on line 147, which currently reads:
wrapper=`mktemp ${TMP:-/tmp}/start-slapd.XXXXXX`
We can change the name of the directory to /var/tmp as follows:
wrapper=`mktemp ${TMP:-/var/tmp}/start-slapd.XXXXXX`
This solves the problem for /etc/init.d/ldap; it is now able to function correctly in an environment where no scripts are allowed to execute in /tmp.