How to setup the Apache2 plugin

In our example, the server hosting fusiondirectory will be the same server that hosts the webserver and we call him fd-server.

In a production installation do not forget to adjust the configuration to your network infrastructure.

Install required packages

On the FusionDirectory server :

debian:

On Debian Squeeze

root@fd-server:~# apt-get install fusiondirectory-plugin-apache2

rpm: <TODO>

yum install fusiondirectory-plugin-apache2

archlinux: <TODO>

archlinux user, please edit

Add the required ldap schema file for Apache2

The apache2 plugin needs ldap schema mod_vhost_ldap.

On FusionDirectory server :

debian:

On Debian Squeeze

You can find this schema in /usr/share/fusiondirectory-plugin-apache2/contrib/ :

root@fd-server:~# fusiondirectory-insert-schema -i /usr/share/doc/fusiondirectory-plugin-apache2/contrib/mod_vhost_ldap.schema

rpm: <TODO>

rpm user, please edit

archlinux: <TODO>

archlinux user, please edit

You will get something like this:

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
executing 'ldapadd -Y EXTERNAL -H ldapi:/// -f /usr/share/doc/fusiondirectory-plugin-apache2/contrib/mod_vhost_ldap.ldif'SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=mod_vhost_ldap,cn=schema,cn=config"

Install the required modules for Apache2

The plugin Apache2 needs module vhost_ldap for Apache2 in order to work.

On the web server :

debian:

On Debian Squeeze

root@fd-server:~# apt-get install libapache2-mod-vhost-ldap

rpm: <TODO>

rpm user, please edit

archlinux: <TODO>

archlinux user, please edit

We need to configure the module vhost_ldap to ensure that it makes right search of virtualhost in the ldap directory.

So you need to edit the file /etc/apache2/mods-available/vhost_ldap.conf.

On the web server, the file should look like :

debian:

On Debian Squeeze

### mod_vhost_ldap depends on mod_ldap ###
### you have to enable mod_ldap as well ###

<IfModule mod_vhost_ldap.c>
    VhostLDAPEnabled on
    VhostLDAPUrl "ldap://localhost:389/cn=fd-server,ou=servers,ou=systems,dc=acme,dc=com"
    VhostLdapBindDN "cn=admin,dc=acme,dc=com"
    VhostLDAPBindPassword "changeme"
</IfModule>
  • VhostLDAPEnabled Set to off to disable vhost_ldap.
  • VhostLDAPUrl The name/port of the ldap server and the DN of the branch of the directory where all searches should start from.
  • VhostLdapBindDN An optional DN used to bind to the server when searching for entries. If not provided, vhost_ldap will use an anonymous bind.
  • VhostLDAPBindPassword A bind password to use in conjunction with the bind DN.

More informations about vhost_ldap module

rpm: <TODO>

rpm user, please edit

archlinux: <TODO>

archlinux user, please edit

Add the Apache service to a system in fusiondirectory

debian, rpm, archlinux:

1. If not already done, create a new server in fusiondirectory. See How to setup the systems-plugin

2. Click on the fd-server :

3. Click on Services :

4. Create new Service :

5. Choose Apache service and click “Continue” :

6. To add a new virtual host apache, click on “Add” :

7. Enter the data for your new Virtual Host. In the example, as fusiondirectory and the web server are on the same server, we will focus on creating a virtual host for the web interface of FusionDirectory. Then press “Save” to save :

  • Virtual host name : The name we give to our virtual host, in the example fusiondirectory
  • Document root : The path to the folder where are located the files of our web interface, in the example /usr/share/fusiondirectory/html
  • Admin mail address : The email address of the webmaster, in the example admin@acme.com

8. And then in the apache virtual hosts you will see that of fusiondirectory :

9. If you have other hosts to be added, repeat steps from step 6. When you have finished click on “Save” :

and then again on “Ok” :

Load modules for Apache2

The module vhost_ldap requires the activation of ldap module for Apache2.

On the web server :

debian:

On Debian Squeeze

root@fd-server:~# a2enmod ldap
root@fd-server:~# a2enmod vhost_ldap
root@fd-server:~# service apache2 restart

rpm: <TODO>

rpm user, please edit

archlinux: <TODO>

archlinux user, please edit
en/documentation/plugin/apache_plugin/how_to_setup_apache2_plugin.txt · Last modified: 2017/10/31 10:32 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0