## Notes

This install receipt requires that the machine has Internet access to access the PyPI repository.

If you use another Debian or Ubuntu version the Python version might differ.

Users of Debian Wheezy might consider trying Marc's web2ldap package.

## 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 python2.6-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.

    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 itself

### Unpack, move and check

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

    wget http://www.web2ldap.de/download/web2ldap-version.tar.gz
    tar xzf web2ldap-version.tar.gz
    mv web2ldap-version.tar.gz /opt/web2ldap

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

    python2.6 /opt/web2ldap/sbin/checkinst.py

Relax the IP restrictions by editing web2ldap-version/etc/web2ldap/web2ldapcnf/standalone.py

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

    python2.6 /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/python2.6/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.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 enabled:

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