Difference between revisions of "PhpLDAPadmin"

From ArchWiki
Jump to: navigation, search
(proper spelling)
(Fatal error: Call to undefined function bindtextdomain() fix, added extension=gettext.so to /etc/php/php.ini)
 
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Web Server]]
 
 
{{lowercase title}}
 
{{lowercase title}}
 +
[[Category:Web server]]
 +
[[ja:PhpLDAPadmin]]
 
[http://phpldapadmin.sourceforge.net/ phpLDAPadmin] is an web-based [[LDAP]] adminstration interface.
 
[http://phpldapadmin.sourceforge.net/ phpLDAPadmin] is an web-based [[LDAP]] adminstration interface.
  
Line 11: Line 12:
 
Install the package {{Pkg|phpldapadmin}} from the [[official repositories]].
 
Install the package {{Pkg|phpldapadmin}} from the [[official repositories]].
  
==Configure PHP==
+
==Configuration==
  
You need to enable the {{ic|php-ldap}} extension in PHP by editing {{ic|/etc/php/php.ini}} and uncommenting the line
+
===Apache===
;extension=ldap.so
+
Create the Apache configuration file:
 +
{{hc|/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>
 +
}}
  
Add the following to the {{ic|open_basedir}} line in {{ic|php.ini}}:
+
And include it in {{ic|/etc/httpd/conf/httpd.conf}}:
  :/usr/share/webapps/
+
  # phpLDAPadmin configuration
 +
Include conf/extra/phpldapadmin.conf
  
==Configuration==
+
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's configuration file is located at {{ic|/etc/webapps/phpldapadmin/config.php}}. It should be usable without making any modifications.
+
===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
  
Although not strictly neccessary you can edit {{ic|config.php}} and name your server with the line
+
You also need to enable the {{ic|gettext}} extension so that PHP can use the bindtextdomain() function
  $servers->setValue('server','host','127.0.0.1');
+
  ;extension=gettext.so
  
Copy the Apache configuration file:
+
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}} :
# cp /etc/webapps/phpldapadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpldapadmin.conf
+
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps
  
And include it in {{ic|/etc/httpd/conf/httpd.conf}}:
+
===phpLDAPadmin configuration===
  # 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.
Include conf/extra/httpd-phpldapadmin.conf
+
 
 +
If your LDAP server is not on the localhost, uncomment and edit the following line:
 +
  $servers->setValue('server','host','127.0.0.1');
  
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:
+
Although not strictly necessary you can name your server by editing the following line:
  allow from all
+
  $servers->setValue('server','name','My LDAP server');
  
 
==Accessing your phpLDAPadmin installation==
 
==Accessing your phpLDAPadmin installation==
Line 40: Line 55:
 
Your phpLDAPadmin installation is now complete. Before start using it you need to restart Apache.
 
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
+
You can access your phpLDAPadmin installation by going to http://localhost/phpldapadmin/

Latest revision as of 02:46, 6 July 2016

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 also need to enable the gettext extension so that PHP can use the bindtextdomain() function

;extension=gettext.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/