Difference between revisions of "PhpLDAPadmin"

From ArchWiki
Jump to: navigation, search
m (Lonaowna moved page PhpLDAPadmin HOWTO to PhpLDAPadmin)
(update and clean up article)
Line 1: Line 1:
 
[[Category:Web Server]]
 
[[Category:Web Server]]
 +
[http://phpldapadmin.sourceforge.net/ phpLDAPadmin] is an web-based [[LDAP]] adminstration interface.
 +
 
==Pre-Installation==
 
==Pre-Installation==
  
 
See [[LAMP]] for a guide to setting up Apache, MySQL, and PHP.
 
See [[LAMP]] for a guide to setting up Apache, MySQL, and PHP.
  
==Adding php-ldap==
+
==Installation==
  
PHP needs the php-ldap extension to work with [http://phpldapadmin.sourceforge.net/ phpLDAPadmin]
+
Install the package {{Pkg|phpldapadmin}} from the [[official repositories]].
  
<pre>
+
==Configure PHP==
pacman -S php-ldap
+
</pre>
+
  
then edit {{ic|/etc/php/php.ini}} and uncomment the line
+
You need to enable the {{ic|php-ldap}} extension in PHP by editing {{ic|/etc/php/php.ini}} and uncommenting the line
 +
;extension=ldap.so
 +
by removing the {{ic|;}}
  
<pre>
+
Add the following to the {{ic|open_basedir}} line in {{ic|php.ini}}:
;extension=ldap.so
+
:/usr/share/webapps/
</pre>
+
 
+
by removing the ";" so it will look like this
+
 
+
<pre>
+
extension=ldap.so
+
</pre>
+
 
+
Now add
+
 
+
<pre>
+
:/usr/share/webapps/phpldapadmin/lib/
+
</pre>
+
 
+
to the "open_basedir" line.
+
 
+
==Installation==
+
 
+
Simply do
+
 
+
<pre>
+
pacman -S phpldapadmin
+
</pre>
+
  
 
==Configuration==
 
==Configuration==
  
phpLDAPadmin comes with a usable configuration file located at:
+
phpLDAPadmin's configuration file is located at {{ic|/etc/webapps/phpldapadmin/config.php}}. It should be usable without making any modifications.
 
+
<pre>
+
/etc/webapps/phpldapadmin/config.php
+
</pre>
+
  
 
Although not strictly neccessary you can edit {{ic|config.php}} and name your server with the line  
 
Although not strictly neccessary you can edit {{ic|config.php}} and name your server with the line  
 +
$servers->setValue('server','host','127.0.0.1');
  
<pre>
+
Copy the Apache configuration file:
$servers->setValue('server','host','127.0.0.1');
+
# cp /etc/webapps/phpldapadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpldapadmin.conf
</pre>
+
  
phpLDAPadmin now installs to {{ic|/usr/share/webapps}}. This means some changes to the configuration are required.
+
And include it in {{ic|/etc/httpd/conf/httpd.conf}}:
 +
  # phpldapadmin configuration
 +
Include conf/extra/httpd-phpldapadmin.conf
  
Copy the configuration file as follows:
+
Edit {{ic|/etc/webapps/phpldapadmin/.htaccess}} and change it to your liking. For example, if you want to be able to access phpLDAPadmin from any machine:
 
+
allow from all
<pre>
+
sudo cp /etc/webapps/phpldapadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpldapadmin.conf
+
</pre>
+
 
+
It should look like this:
+
 
+
<pre>
+
  Alias /phpldapadmin "/usr/share/webapps/phpldapadmin"
+
  <Directory "/usr/share/webapps/phpldapadmin">
+
    AllowOverride All
+
    Options FollowSymlinks
+
    Order allow,deny
+
    Allow from all
+
    php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:/usr/share/pear/"
+
  </Directory>
+
</pre>
+
 
+
{{Note|If you are getting 403 errors, make sure the 'A' is correct case: ''phpldapadmin'' instead of ''phpldapAdmin''.}}
+
 
+
Add the following lines to {{ic|/etc/httpd/conf/httpd.conf}}:
+
 
+
<pre>
+
# phpldapadmin configuration
+
Include conf/extra/httpd-phpldapadmin.conf
+
</pre>
+
 
+
Edit {{ic|/usr/share/webapps/phpldapadmin/.htaccess}} and comment out deny from all, otherwise you will receive a 403 access denied error.  It should look like this:
+
 
+
<pre>
+
#deny from all
+
</pre>
+
  
 
==Accessing your phpMyAdmin installation==
 
==Accessing your phpMyAdmin installation==
  
Finally your phpLDAPadmin installation is complete. Before start using it you need to restart your apache server by following command:
+
Your phpLDAPadmin installation is now complete. Before start using it you need to restart Apache.
 
+
<pre>
+
# /etc/rc.d/httpd restart
+
</pre>
+
 
+
You can access your phpLDAPadmin installation using the following url:
+
 
+
<pre>
+
http://serverip/phpldapadmin
+
or
+
http://localhost/phpldapadmin
+
</pre>
+
  
Note: 'localhost' is the hostname in your {{ic|/etc/rc.conf}} file.
+
You can access your phpLDAPadmin installation by going to http://localhost/phpldapadmin

Revision as of 20:29, 29 September 2013

phpLDAPadmin is an web-based LDAP adminstration interface.

Pre-Installation

See LAMP for a guide to setting up Apache, MySQL, and PHP.

Installation

Install the package phpldapadmin from the official repositories.

Configure PHP

You need to enable the php-ldap extension in PHP by editing /etc/php/php.ini and uncommenting the line

;extension=ldap.so
by removing the ;

Add the following to the open_basedir line in php.ini:

:/usr/share/webapps/

Configuration

phpLDAPadmin's configuration file is located at /etc/webapps/phpldapadmin/config.php. It should be usable without making any modifications.

Although not strictly neccessary you can edit config.php and name your server with the line

$servers->setValue('server','host','127.0.0.1');

Copy the Apache configuration file:

# cp /etc/webapps/phpldapadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpldapadmin.conf

And include it in /etc/httpd/conf/httpd.conf:

# phpldapadmin configuration
Include conf/extra/httpd-phpldapadmin.conf

Edit /etc/webapps/phpldapadmin/.htaccess and change it to your liking. For example, if you want to be able to access phpLDAPadmin from any machine:

allow from all

Accessing your phpMyAdmin installation

Your phpLDAPadmin installation is now complete. Before start using it you need to restart Apache.

You can access your phpLDAPadmin installation by going to http://localhost/phpldapadmin