CentLinux | Learn How to Install CentOS/Rocky Linux Servers

Sunday, June 3, 2018

Install phpLDAPadmin on CentOS 7 LAMP Server

Install phpLDAPadmin on CentOS 7 LAMP Server

phpLDAPadmin is web based application for easy administration of OpenLDAP directory server. phpLDAPAdmin is written in PHP, therefore it requires a LAMP/LEMP server for deployment. I have already configured the LAMP server and now we are installing the phpLDAPadmin application on it.

Read Also: Install Linux, Apache, MySQL & PHP (LAMP) Stack
  Install Linux, Nginx, MySQL & PHP (LEMP) Stack

 

System Specification:

The same server that I used in my previous post “Configure Remote Authentication Server using OpenLDAP 2.4“.

Install phpLDAPadmin on CentOS 7 LAMP Server

Configure phpLDAPadmin:

First of all, I must add the EPEL yum Repository, to ease the installation of phpLDAPAdmin.

# rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
warning: /var/tmp/rpm-tmp.HqBu3J: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...    1:epel-release-7-11                ################################# [100%]

# yum makecache

Now, install phpLDAPAdmin, Apache and PHP.

# yum -y install phpldapadmin httpd php

Enable and Start Apache service.

# systemctl enable httpd && systemctl start httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'

Allow Apache service port thru firewall.

# firewall-cmd --permanent --add-service=http
success # firewall-cmd --reload
success

Edit the phpMyadmin web server configurations. Final configurations after editing should be like this (the change is highlighted in yellow color).

# cat /etc/httpd/conf.d/phpldapadmin.conf
# #  Web-based tool for managing LDAP servers #
Alias /phpldapadmin /usr/share/phpldapadmin/htdocs Alias /ldapadmin /usr/share/phpldapadmin/htdocs
<Directory /usr/share/phpldapadmin/htdocs>
   <IfModule mod_authz_core.c>
     # Apache 2.4     Require all granted
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from all
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule> </Directory> # systemctl restart httpd

Open URL http://ldapserver.itlab.com/phpldapadmin in web browser.

01-install-phpldapadmin-centos-7-main-page02-install-phpldapadmin-centos-7-login

To keep the scope limited, I am running phpLDAPAdmin application without SSL. Therefore, it is displaying Warning: This web connection is unencrypted. To run it over an encrypted connection, please refer to my previous post Convert an Apache Website from HTTP to HTTPs.

phpLDAPadmin can manage multiple LDAP Servers. We should add our LDAP Server to it.

# vi /usr/share/phpldapadmin/config/config.php

Add following lines before the php end-tag i.e. ?>

$servers->newServer('ldap_pla');
$servers->setValue('server','name','ldapserver.itlab.com');
$servers->setValue('server','host','127.0.0.1');
$servers->setValue('server','port',389);
$servers->setValue('server','base',array('dc=itlab,dc=com'));
$servers->setValue('login','auth_type','cookie');
$servers->setValue('login','bind_id','cn=ldapadm,dc=itlab,dc=com');
$servers->setValue('login','bind_pass','123');
$servers->setValue('server','tls',false);

Login to web console using LDAP Manager User.

03-install-phpldapadmin-centos-7-login04-install-phpldapadmin-centos-7-main-page

phpLDAPadmin application has been installed on CentOS 7 and our OpenLDAP Directory Server has been added to it.

If you find this article useful? Consider supporting us by Buy Me A Coffee


© 2023 CentLinux. All Rights Reserved.