Installing on Debian Squeeze/Wheezy

A brief description on how to install it on Debian Squeeze or Wheezy

Notes in advance

Debian packages

These packages are required for compiling/installing python-ldap via Python's setuptools (see easy_install below):

apt-get install gcc (maybe more related packages)
apt-get install libsasl2-dev libldap-dev python-dev python-setuptools python-netaddr

Optional but useful

For automagically converting jpegPhoto attribute values:

apt-get install python-imaging python-m2crypto

PyPI source packages

Some required modules are not available as Debian packages or the Debian packages are too old (especially python-ldap).
So we proceed here with Python setup tools which automagically downloads and build the latest releases from PyPI repository.

Set proxy settings if needed:

export http_proxy="http://proxy.example.com:8080"
export https_proxy="http://proxy.example.com:8080"
export ftp_proxy="http://proxy.example.com:8080"

Install needed modules:

easy_install python-ldap
easy_install pyweblib
easy_install pyasn1
easy_install pyasn1_modules

Optional but useful modules

easy_install pydns
easy_install pyexcelerator

web2ldap application

Unpack, move and check

Grab web2ldap source, extract anywhere and it move to /opt/web2ldap:

wget https://www.web2ldap.de/download/web2ldap-1.2.70.tar.gz
tar xzf web2ldap-1.2.70.tar.gz --no-same-owner
mv web2ldap-1.2.70 /opt/web2ldap

Check whether all software is installed - watch out for errors and warnings:

python /opt/web2ldap/sbin/checkinst.py

Relax the IP restrictions by editing bind_address and access_allowed in file /opt/web2ldap/etc/web2ldap/web2ldapcnf/standalone.py if you want to make web2ldap accessible by others over network.

For testing start built-in HTTP server listening on all interfaces:

python /opt/web2ldap/sbin/web2ldap.py -l 0.0.0.0:1760 -d off

Access it with your browser:

http://your-server-hostname-or-address-here:1760/web2ldap

Integrate with Apache/mod_fcgid

Install packages for running as FastCGI server:

apt-get install apache2-mpm-prefork libapache2-mod-fcgid
wget -O /usr/lib/pymodules/python/fcgi.py http://alldunn.com/python/fcgi.py

Copy sample web2ldap's configuration and edit to suit your needs (e.g. allowed IP addresses):

cp /opt/web2ldap/etc/httpd/sample-mod_fcgid-2.2.conf /etc/apache2/conf.d/web2ldap-fcgid.conf
$EDITOR /etc/apache2/conf.d/web2ldap-fcgid.conf
/etc/init.d/apache2 restart

Access it with your browser (takes a bit longer the first time):

http://your-server-hostname-or-address-here/web2ldap

or if your server already is configured with SSL/TLS enabled:

https://your-server-hostname-or-address-here/web2ldap