Centos 6 / ldap

All about webserver configurations, PHP and databases.

Moderator: Thorsten

Post Reply
sfara
Posts: 3
Joined: Sun Jul 05, 2015 9:23 am

Centos 6 / ldap

Post by sfara »

Hello,
I'm new to phpmyfaq and ldap so can someone please couch me how to actually use phpmyfaq with ldap.

So far i've installed it on the server, i've made an account as requested on the first configuration page and it's all working well but now i need to be able to log in using the AD credentials.

Some questions:
1. This is a Centos 6.5 machine, i've installed the package php-ldap, php -i shows that it's loaded. Do i need anything else to install ? Do i need to actually install OPENLDAP on the machine or just the php module is enought ?

2. The documentation sais "If you want to add LDAP support later, you can use the file config/ldap.php.original as template and if you rename it to config/ldap.php you can use the LDAP features as well after you enabled it in the administration backend". So I've enabled ldap in the administration backend (by the way i could not enable that until i've install the php-ldap module), and i have the ldap.php config file which i now must configure with the following lines:
$PMF_LDAP['ldap_server'] = '';
$PMF_LDAP['ldap_port'] = '';
$PMF_LDAP['ldap_user'] = '';
$PMF_LDAP['ldap_password'] = '';
$PMF_LDAP['ldap_base'] = '';
Now, server and port it's quite clear but i don't know what to input in the last 3 (ldap_user-what user is this ? and ldap_base - what do i input here ?)

And in constants_ldap.php i understand i have to modify these 3 lines:
// Datamapping - in this example for an ADS
$PMF_LDAP['ldap_mapping'] = array (
'name' => 'cn',
'username' => 'samAccountName',
'mail' => 'mail'
);
is the username' => 'samAccountName', the same thing as $PMF_LDAP['ldap_user'] = ''; in ldap.php ?

3. Where can i see the logs for phpmyfaq? checking /var/log/httpd/access.log and error.log ? or are there other log files too ?

Thanks !
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Centos 6 / ldap

Post by Thorsten »

Hi,

are you running a LDAP service in your environment? If no, you don't need LDAP support.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
sfara
Posts: 3
Joined: Sun Jul 05, 2015 9:23 am

Re: Centos 6 / ldap

Post by sfara »

Well this server is just a webserver, no ldap is running on it, but it's part of a network with AD and the users want to authenticate using AD credentials.
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Centos 6 / ldap

Post by Thorsten »

Hi,

thanks for the clarification!
sfara wrote:1. This is a Centos 6.5 machine, i've installed the package php-ldap, php -i shows that it's loaded. Do i need anything else to install ? Do i need to actually install OPENLDAP on the machine or just the php module is enought ?
You'll need only php-ldap, no OpenLDAP on that machine.
sfara wrote:2. The documentation sais "If you want to add LDAP support later, you can use the file config/ldap.php.original as template and if you rename it to config/ldap.php you can use the LDAP features as well after you enabled it in the administration backend". So I've enabled ldap in the administration backend (by the way i could not enable that until i've install the php-ldap module), and i have the ldap.php config file which i now must configure with the following lines:
$PMF_LDAP['ldap_server'] = '';
$PMF_LDAP['ldap_port'] = '';
$PMF_LDAP['ldap_user'] = '';
$PMF_LDAP['ldap_password'] = '';
$PMF_LDAP['ldap_base'] = '';
Now, server and port it's quite clear but i don't know what to input in the last 3 (ldap_user-what user is this ? and ldap_base - what do i input here ?)
"ldap_user" is a user who can connect and bind with your AD, normally a technical user. "ldap_password" is the password for this user.

"ldap_base" is the distinguished name, e.g. 'cn=John Doe,ou=Accounts,o=My Company,c=US'.
sfara wrote:And in constants_ldap.php i understand i have to modify these 3 lines:
// Datamapping - in this example for an ADS
$PMF_LDAP['ldap_mapping'] = array (
'name' => 'cn',
'username' => 'samAccountName',
'mail' => 'mail'
);
is the username' => 'samAccountName', the same thing as $PMF_LDAP['ldap_user'] = ''; in ldap.php ?
Normally you don't have to change this as it's already in the AD format.
sfara wrote:3. Where can i see the logs for phpmyfaq? checking /var/log/httpd/access.log and error.log ? or are there other log files too ?
There are no other logs.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
sfara
Posts: 3
Joined: Sun Jul 05, 2015 9:23 am

Re: Centos 6 / ldap

Post by sfara »

Thank you for the answers!!
Post Reply