A brief description on how to install it on Debian Jessie or later
These packages are required for compiling/installing python-ldap via Python's setuptools (see easy_install below):
apt-get install gcc libsasl2-dev libldap-dev python-virtualenv python-dev python-setuptools python-netaddr
For automagically converting jpegPhoto attribute values:
apt-get install python-imaging python-m2crypto python-dns python-excelerator python-paramiko
Grab web2ldap source, extract anywhere and it move to /opt/web2ldap:
wget https://www.web2ldap.de/download/web2ldap-1.2.71.tar.gz tar xzf web2ldap-1.2.71.tar.gz --no-same-owner mv web2ldap-1.2.71 /opt/web2ldap
Initialize Python virtual environment:
python2.7 -m virtualenv -v --system-site-packages /opt/web2ldap
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:
/opt/web2ldap/bin/pip2.7 install python-ldap pyweblib pyasn1 pyasn1_modules
Check whether all software is installed - watch out for errors and warnings:
/opt/web2ldap/bin/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:
/opt/web2ldap/bin/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
Install packages for running as FastCGI server:
apt-get install apache2-mpm-prefork libapache2-mod-fcgid wget -O /opt/web2ldap/lib/python2.7/site-packages/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/fcgi/web2ldap.py /opt/web2ldap/fcgi/web2ldap.py.orig sed 's|/usr/bin/python|/opt/web2ldap/bin/python|' /opt/web2ldap/fcgi/web2ldap.py.orig > /opt/web2ldap/fcgi/web2ldap.py cp /opt/web2ldap/etc/httpd/sample-mod_fcgid-2.4.conf /etc/apache2/conf-available/web2ldap-fcgid.conf $EDITOR /etc/apache2/conf-available/web2ldap-fcgid.conf a2enconf web2ldap-fcgid.conf service apache2 reload
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