Solved

CentOS PHP connection to LDAP via LDAPS

Posted on 2014-09-03
9
569 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
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.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

733 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