Solved

CentOS PHP connection to LDAP via LDAPS

Posted on 2014-09-03
9
580 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

734 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