Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CentOS PHP connection to LDAP via LDAPS

Posted on 2014-09-03
9
Medium Priority
?
628 Views
Last Modified: 2014-09-11
Hi Everyone,

I have a server configured with openSuse that connects to our Novell LDAP trees via ldaps.  Now we are starting to move to CentOS and I'm having trouble configuring it the same way.

On the OpenSuse server, I would install all the php ldap, openldap, openssl components.  I would install our certificate.  Then I'd edit /etc/ldap.conf file and add in
TLS_REQCERT never
TLS_CRLCHECK never
TLS_CACERT /etc/ssl/certs/ldap.pem

I would also edit /etc/openldap/ldap.conf and add this:

TLS_REQCERT never
TLS_CRLCHECK never

TLS_CACERT /etc/ssl/certs/ldap.pem
TLS_CACERTDIR /etc/ssl/certs

Once I did this I could use ldaps no problem.

Now, in CentOS I'm trying to achieve the same thing,  But I can't find a /etc/ldap.conf file.

Any direction on this would be greatly appreciated.
0
Comment
Question by:Tigger996
  • 5
  • 4
9 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 40303063
It is in /etc/openldap
0
 

Author Comment

by:Tigger996
ID: 40306190
In OpenSuse, there is /etc/ldap.conf and /etc/openldap/ldap.conf.   For me to get php to connect via ldaps I had to put the added code in both.  

Do you have any other suggestions on what I can try?
0
 
LVL 62

Accepted Solution

by:
gheist earned 2000 total points
ID: 40309325
Following ldap.conf files are used if at all.
I suggest you go with first one only as others aew used by other separate services.

/etc/openldap/ldap.conf
/etc/openvpn/auth/ldap.conf
/usr/share/doc/openssh-ldap-5.3p1/ldap.conf
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

Author Comment

by:Tigger996
ID: 40310580
I have edited the /etc/openldap/ldap.conf file and I still can't connect in php to ldaps but I can't connect to the ldap server with no ldaps.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40311501
TLS_REQCERT never
should be entered in first file as in
"man ldap.conf"
and other files cleaned up from apache's profile
0
 

Author Comment

by:Tigger996
ID: 40312565
What do you mean " other files cleaned up from apache's profile "
0
 
LVL 62

Expert Comment

by:gheist
ID: 40312595
.ldaprc in /var/www and similar
0
 
LVL 62

Expert Comment

by:gheist
ID: 40312601
Check also audit logs (grep AVC /var/log/audit/audit.log) for SELinux violations.
0
 

Author Comment

by:Tigger996
ID: 40317530
I figured out a couple of things.  I was using the adodb library for php and it was not connecting right.  Once I did some testing and updated some files I figured out that it was in fact connecting via ldaps and all works great now.

Thank you for your patience.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question