OpenLDAP

How to install phpLDAPadmin on CentOS 7

Share on Social Media

Learn how to install phpLDAPadmin on CentOS 7 with our step-by-step guide. Simplify LDAP directory management with this powerful web-based tool. #centlinux #linux #cyebrsecurity

What is phpLDAPadmin?

phpLDAPadmin (PLA) is a web-based application for administering LDAP servers. It is written in PHP and provides an easy-to-use interface for managing LDAP data. Here are some key features and functionalities of phpLDAPadmin:

  1. Web-Based Interface: PLA provides a user-friendly web interface, making it accessible from any device with a web browser.
  2. LDAP Directory Management: It allows administrators to browse, search, and manage entries in an LDAP directory.
  3. Schema Management: PLA supports schema management, enabling administrators to view and modify the LDAP schema.
  4. Access Control: Administrators can set up and manage access control lists (ACLs) to define who can access or modify specific parts of the LDAP directory.
  5. User and Group Management: PLA facilitates the creation, deletion, and modification of user and group entries, making it easier to manage organizational data.
  6. Customizable Interface: The application is highly customizable, allowing administrators to tailor the interface to their specific needs and workflows.
  7. Support for Multiple LDAP Servers: PLA can connect to multiple LDAP servers, providing a centralized management interface for different directory services.
  8. Logging and Auditing: It includes logging and auditing features to track changes and monitor access to the LDAP directory.

Overall, phpLDAPadmin simplifies the management of LDAP directories by providing a graphical interface that reduces the need for complex command-line operations.

Recommended Online Training: Learn Bash Shell in Linux for Beginners

Linux Server Specification

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.

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

Install phpLDAPadmin on CentOS 7

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

phpLDAPadmin Configuration

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.

phpLDAPadmin Admin Console
phpLDAPadmin 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.

phpLDAPadmin Add LDAP Server
phpLDAPadmin Dashboard

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

If you are new to Linux and facing difficulty in working at Linux Bash prompt. We recommend that, you should read The Linux Command Line, 2nd Edition: A Complete Introduction by William Shotts.

Final Thoughts

Installing phpLDAPadmin on CentOS 7 can greatly simplify the management of your LDAP directories, providing a user-friendly interface to handle complex tasks with ease. Whether you’re setting up a new LDAP server or looking to enhance your current system’s functionality, phpLDAPadmin is a powerful tool to consider.

If you need further assistance or prefer professional help with your phpLDAPadmin installation and configuration, feel free to check out my Fiverr gig. I offer comprehensive services to ensure your LDAP setup is efficient and secure. Let me help you streamline your directory management with ease!

Alaric Bird

Alaric Bird is a seasoned Linux System Administrator with over a decade of experience in managing and optimizing Linux-based servers and infrastructure. Known for his expertise in server deployment, security hardening, and performance tuning, Alaric has a deep understanding of various Linux distributions, including Ubuntu, CentOS, and Red Hat Enterprise Linux. His skills extend to cloud platforms like AWS, where he effectively manages virtual private servers and services. Alaric is also proficient in scripting languages such as Bash and Python, which he uses to automate routine tasks, enhancing efficiency and reliability. With a strong commitment to continuous learning, he stays updated with the latest developments in open-source technologies and best practices. His problem-solving abilities, combined with excellent communication skills, make him a valuable asset to any IT team. In addition to his technical expertise, Alaric is passionate about mentoring junior administrators and fostering a collaborative environment.

Share
Published by
Alaric Bird

Recent Posts

Puppy Linux: Fast and Simple OS

Puppy Linux is a fast, lightweight OS designed for speed and simplicity, perfect for old…

2 days ago

Change Apache Document Root in Linux

Learn how to change Apache document root in Linux by following this step-by-step guide. Adjust…

2 weeks ago

How to Change Apache Port in Linux

Discover how to change Apache port in Linux easily. Follow our simple guide to modify…

2 weeks ago

How to Create Virtual Host in Apache Server

Learn how to create a virtual host in Apache Server with this comprehensive guide. Set…

3 weeks ago

10 Practical Tasks for RHCSA Exam with Solutions

Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills…

3 weeks ago

Ultimate Fail2ban Configuration Guide

Discover the ultimate Fail2ban configuration guide. Learn how to set up, customize, and optimize Fail2ban…

4 weeks ago

This website uses cookies.