• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to configure OpenLDAP Server and phpLDAP admin

{{postValue.id}}

To Install and configure OpenLDAP Server and phpLDAP admin in Linux

OpenLDAP is an open source protocol developed by OpenLDAP Project and released under OpenLDAP Public License. Its protocol is platform-independent. Installation and Configuration of an OpenLDAP server and Administration with phpLDAPadmin in Debian/Ubuntu systems is explained in this article.

To Install OpenLDAP server

To install LDAP the respective package name in Ubuntu is slapd.

root@server:~# apt-get install slapd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libavahi-client-dev libavahi-common-dev libavahi-compat-libdnssd1
  libdbus-1-dev libntdb1 libruby2.1 libyaml-0-2 python-ntdb ruby2.1
  rubygems-integration
Use ' apt-get autoremove'  to remove them.
Suggested packages:
  libsasl2-modules-gssapi-mit libsasl2-modules-gssapi-heimdal
The following NEW packages will be installed:
  slapd
.
.
.
Backing up /etc/ldap/slapd.d in /var/backups/slapd-2.4.41+dfsg-1ubuntu2... done.
Processing triggers for libc-bin (2.21-0ubuntu4.1) ...

Enter the admin password for LDAP directory.
package_configuration

Re-type to verify your password.
verify

Execute the below command to install LDAP utilities.

root@server:~# apt-get install ldap-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libavahi-client-dev libavahi-common-dev libavahi-compat-libdnssd1
libdbus-1-dev libntdb1 libruby2.1 libyaml-0-2 python-ntdb ruby2.1
.
.
.
Setting up ldap-utils (2.4.41+dfsg-1ubuntu2) ...

To Configure OpenLDAP Server

Edit the ldap.conf file, which is located in the /etc/ldap/ldap.conf directory.

root@server:~# sudo nano /etc/ldap/ldap.conf
#
# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
#BASE dc=example,dc=com
#URI ldap://ldap.example.com ldap://ldap-master.example.com:666
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
# TLS certificates (needed for GnuTLS)
TLS_CACERT /etc/ssl/certs/ca-certificates.crt

Uncomment the BASE and URI lines, then add your domain name and IP.

BASE dc=linuxhelp1,dc=com
URI ldap://server.linuxhelp1.com ldap://server.linuxhelp1.com:666
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
# TLS certificates (needed for GnuTLS)
TLS_CACERT /etc/ssl/certs/ca-certificates.crt

Save and exit the file.
Execute the below command to reconfigure the LDAP package.

root@server:~# sudo dpkg-reconfigure slapd

The package configuration page appears. Choose ' no' to continue with the configuration.
configuration

To Construct the base Domain Name of the LDAP directory, Enter the DNS domain name and click Enter to confirm it.
dns_domain

Then Enter the name of your organisation and click ok .
organization

Once the organisation name is added, the package configuration request for the administrator password. Enter the password that you have created during installation.
administrator

Now choose the database of your choice. The BDB and HDB database supports the same configuration options using similar storage formats, whereas MDB adds additional support for sub-tree renames.
database

Choose ' No' to save the database selected. If you choose ' Yes' the database will be removed.
select_database

In the confirmation window choose ' Yes' to move the old database.
configuration

If you want to continue with LDAPv2 protocol choose ' Yes' , in case LDAPv3 protocol is pre-installed then continue with ' No' .
configure

Moving old database directory to /var/backups:
- directory unknown... done.
Creating initial configuration... done.
Creating LDAP directory... done.
Processing triggers for libc-bin (2.21-0ubuntu4.1) ...

Now the LDAP server is installed successfully.

To test LDAP server

Run the ' ldapsearch -x' command to test the server.

root@server:~# ldapsearch -x
# extended LDIF
#
# LDAPv3
# base < dc=linuxhelp1,dc=com>  (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# linuxhelp1.com
dn: dc=linuxhelp1,dc=com
objectClass: top
objectClass: dcObject
objectClass: organization
o: linuxhelp.com
dc: linuxhelp1
# admin, linuxhelp1.com
dn: cn=admin,dc=linuxhelp1,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
# search result
search: 2
result: 0 Success
# numResponses: 3
# numEntries: 2

LDAP Administration with phpLDAPadmin

phpLDAPadmin is a GUI tool for the LDAP server administration. The GUI tool helps us to interact with your LDAP server via web interface.
Install phpLDAPadmin by running the following command.


Note: Your system must contain Apache web server and PHP before installing phpLDAPadmin.

root@server:~# apt-get install phpldapadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libavahi-client-dev libavahi-common-dev libavahi-compat-libdnssd1
libdbus-1-dev libntdb1 libruby2.1 libyaml-0-2 python-ntdb ruby2.1
.
.
.
Setting up phpldapadmin (1.2.2-5.2) ...

To Configure phpldapadmin

To configure phpLDAPadmin open the ' config.php' file located in ' /etc/phpldapadmin/config.php' .

root@server:~# vim /etc/phpldapadmin/config.php

Edit the following lines in the configuration file.

$config-> custom-> appearance[' timezone' ] = ' Asia/Kolkata'  
$servers-> setValue(' server' ,' name' ,' linuxhelp1 LDAP Server' ) 
$servers-> setValue(' server' ,' host' ,' 192.168.5.192' ) 
$servers-> setValue(' server' ,' base' ,array(' dc=linuxhelp1,dc=com' )) 
$servers-> setValue(' login' ,' bind_id' ,' cn=admin,dc=linuxhelp1,dc=com' ) 

Now Restart the Apache service.

root@server:~# service apache2 restart

Open the port 80 and port 389, which are the default ports for LDAP in the firewall by executing the following command.

root@server:~# ufw allow 80
Rules updated
Rules updated (v6) 
root@server:~# ufw allow 389
Rules updated
Rules updated (v6)

Navigate to ' http://< ip_address> /phpldapadmin' and click Enter
start_program

The LDAP home page appears as shown below.
home page

Click ' login' on the left panel. Enter the LDAP Admin password and click ' authenticate' .
admin_password

The main console of the phpadmin appears.
main_console

Now you can add additional object, such as organizational unit, users, group etc., to phpadmin. Click on ' +' sign and click ' create new entry here' .
additional_object

Choose the ' Generic-Organizational Unit' for creating Active Directory.
active_directory

Enter the name of the organizational unit and click ' create object'
create_object

Click ' commit' to save changes.
changes

Now the newly created organizational unit (ou=admin) will appear on the left panel.
phpldapadmin

To create a group, click on admin-group on the left panel and hit on ' create a child entry' .
create_group

Now select ' generic: posix group' to create the group.
generic

Now enter the name of the group and click create object button.
group_name

Click commit to save changes.
commit

Now the newly created group is available inside the organisational unit.
organizational_unit

Now to create a user click on the group and inside that click on ' create child entry button' .
create_child

Click on ' Generic: user account' to create user.
user_account

Now enter the details for the user such as common name, gid number, last name, login shell, user id and user password .
details

After all the details are filled, Click create object.
create_object

Now click commit to save changes
commit

Here you can see a newly created user in the admin group object
new_user
Lets verify the user created using the following command.

root@server:~# ldapsearch &ndash x

This command will display all the details like user, group etc.
details_display

Tags:
christian
Author: 

Comments ( 2 )

vijaysingh
I forgot my console/Admin pwd, however remember my root UN and PWD. What's the procedure to recover "Admin" pwd?
pradeepmahajan
Getting error :ldapsearch -x ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

Which package to be installed by configuring OpenLDAP server?

A

by configuring OpenLDAP by installing following package
apt-get install slapd LDAP-utils

Q

Where to configure the OpenLDAP server in ubuntu?

A

Configure the OpenLDAP server by the following location
nano /etc/ldap/ldap.conf

Q

how to test the LDAP server configuration in ubuntu?

A

Test the configuration for LDAP sever by following command
ldapsearch -x

Q

What is the name of package install phpLDAP server?

A

the name of the package to install phpLDAP server by following command
apt-get install phpldapadmin

Q

How to configure the phpLDAPadmin in ubuntu?

A

Configure phpLDAPadmin in Ubuntu by following location
vim /etc/phpldapadmin/config.php

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Sebastian ?
How to change non required to required field in SuiteCRM Custom/Default Modules

How to change not required to the required field in SuiteCRM Custom/Default Modules?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.