Difference between revisions of "PhpLDAPadmin"

From ArchWiki
Jump to: navigation, search
(Configuration)
m (PHP)
 
(28 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Web Server]]
+
{{lowercase title}}
 +
[[Category:Web server]]
 +
[[ja:PhpLDAPadmin]]
 +
[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==
 
 
PHP needs the php-ldap extension to work with [http://phpldapadmin.sourceforge.net/ phpLDAPadmin]
 
 
<pre>
 
pacman -S php-ldap
 
</pre>
 
 
then edit {{ic|/etc/php/php.ini}} and uncomment the line
 
 
<pre>
 
;extension=ldap.so
 
</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==
 
==Installation==
  
Simply do
+
Install the package {{Pkg|phpldapadmin}} from the [[official repositories]].
 
+
<pre>
+
pacman -S phpldapadmin
+
</pre>
+
  
 
==Configuration==
 
==Configuration==
  
phpLDAPadmin comes with a usable configuration file located at:
+
===Apache===
 
+
Create the Apache configuration file:
<pre>
+
{{hc|/etc/httpd/conf/extra/phpldapadmin.conf|
/etc/webapps/phpldapadmin/config.php
+
Alias /phpldapadmin "/usr/share/webapps/phpldapadmin"
</pre>
+
<Directory "/usr/share/webapps/phpldapadmin">
 
+
    DirectoryIndex index.php
Although not strictly neccessary you can edit {{ic|config.php}} and name your server with the line
+
 
+
<pre>
+
$servers->setValue('server','host','127.0.0.1');
+
</pre>
+
 
+
phpLDAPadmin now installs to {{ic|/usr/share/webapps}}.  This means some changes to the configuration are required.
+
 
+
Copy the configuration file as follows:
+
 
+
<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
 
     AllowOverride All
 
     Options FollowSymlinks
 
     Options FollowSymlinks
     Order allow,deny
+
     Require all granted
    Allow from all
+
</Directory>
    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}}:
+
And include it in {{ic|/etc/httpd/conf/httpd.conf}}:
 +
# phpLDAPadmin configuration
 +
Include conf/extra/phpldapadmin.conf
  
<pre>
+
By default, everyone can see the phpLDAPadmin page, to change this, edit {{ic|/etc/httpd/conf/extra/phpldapadmin.conf}} to your liking. For example, if you only want to be able to access it from the same machine, replace {{ic|Require all granted}} by {{ic|Require local}}.
# 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:
+
===PHP===
 +
You need to enable the {{ic|ldap}} extension in PHP by editing {{ic|/etc/php/php.ini}} and uncommenting the line
 +
  ;extension=ldap.so
  
<pre>
+
You need to make sure that PHP can access {{ic|/usr/share/webapps}} and {{ic|/etc/webapps}}. Add them to {{ic|open_basedir}} in {{ic|/etc/php/php.ini}} :
#deny from all
+
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps
</pre>
+
  
==Accessing your phpMyAdmin installation==
+
===phpLDAPadmin configuration===
 +
phpLDAPadmin's configuration file is located at {{ic|/etc/webapps/phpldapadmin/config.php}}. If you have a local LDAP server, it should be usable without making any modifications.
  
Finally your phpLDAPadmin installation is complete. Before start using it you need to restart your apache server by following command:
+
If your LDAP server is not on the localhost, uncomment and edit the following line:
 +
$servers->setValue('server','host','127.0.0.1');
  
<pre>
+
Although not strictly necessary you can name your server by editing the following line:
# /etc/rc.d/httpd restart
+
$servers->setValue('server','name','My LDAP server');
</pre>
+
  
You can access your phpLDAPadmin installation using the following url:
+
==Accessing your phpLDAPadmin installation==
  
<pre>
+
Your phpLDAPadmin installation is now complete. Before start using it you need to restart Apache.
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/

Latest revision as of 12:56, 19 December 2015

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.

Configuration

Apache

Create the Apache configuration file:

/etc/httpd/conf/extra/phpldapadmin.conf
Alias /phpldapadmin "/usr/share/webapps/phpldapadmin"
<Directory "/usr/share/webapps/phpldapadmin">
    DirectoryIndex index.php
    AllowOverride All
    Options FollowSymlinks
    Require all granted
</Directory>

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

# phpLDAPadmin configuration
Include conf/extra/phpldapadmin.conf

By default, everyone can see the phpLDAPadmin page, to change this, edit /etc/httpd/conf/extra/phpldapadmin.conf to your liking. For example, if you only want to be able to access it from the same machine, replace Require all granted by Require local.

PHP

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

;extension=ldap.so

You need to make sure that PHP can access /usr/share/webapps and /etc/webapps. Add them to open_basedir in /etc/php/php.ini :

open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps

phpLDAPadmin configuration

phpLDAPadmin's configuration file is located at /etc/webapps/phpldapadmin/config.php. If you have a local LDAP server, it should be usable without making any modifications.

If your LDAP server is not on the localhost, uncomment and edit the following line:

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

Although not strictly necessary you can name your server by editing the following line:

$servers->setValue('server','name','My LDAP server');

Accessing your phpLDAPadmin 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/