How to Configure phpLDAPadmin in Ubuntu?

Zyxware default image4

LDAP stands for Lightweight Directory Access Protocol, which was designed to store and retrieve data centrally. Install OpenLDAP and phpLDAPadmin, before reading the configuration steps.

Hope the packages were already installed, we can start configuring a few things, to connect with the OpenLDAP directory structure, created during the LDAP configuration stage.

First, we can update the main configuration file with root privileges for the editor

sudo nano /etc/phpldapadmin/config.php

OR

If you are comfortable with VIM editor use,

sudo vi /etc/phpldapadmin/config.php

or 

sudo vim /etc/phpldapadmin/config.php

We can start updating the configuration details in the file.

  • Update the host parameter to your public IP address or custom domain name.

    $servers->setValue('server','host','IP_or_server_domain_name');
    This will be based on how you are planning to access the 'phpLDAPadmin web interface'.
  • Configure Domain Base Name for the LDAP Server.

    We need to traslate the domain name into LDAP syntax by replacing each components in domain to dc specification. For a domain 'example.com', we can use like dc=example,dc=com. The base parameter can be set as following,
    $servers->setValue('server','base',array('dc=example,dc=com'));
  •  

     

    Configure Login Bind_id.

    We need to update the login bind_id parameter, For that, we just need to update the dc parameter again, additionally it will have the cn parameter, which will be already set to "admin".
    $servers->setValue('login','bind_id','cn=admin,dc=example,dc=com');
  • Finally, we need to Configure the Visibility of Warning Messages.

    Few annoying warning messages will be thrown by default phpLDAPadmin, regarding the template files, which does not have any impact on the functionality. We can simply hide those warnings by updating the 'hide_template_warning' parameter, which will be commented by default. Uncomment the line and set the value to 'true'.
    $config->custom->appearance['hide_template_warning'] = true;
  • Save and Close the File.

    If you are using Vim editor, then press ESC and type,
    :wq
    'w' for write and 'q' for quit.

You are Done!