Page last modified:
Requirements
For running this CGI-BIN you need:
-
Python 1.5.2+
If you have difficulties convincing your server admin to install Python
you might want to have a look at
mxCGIPython - One-file easy-to-install Python interpreter.
-
ldapmodule for Python which needs
OpenLDAP
for the build.
-
Your web browser has to be aware of <TABLE>-tags.
-
For using non-USASCII characters the web browser must be
aware of character presentation like &<character code>;.
The user's input is assumed to be ISO-8859-1.
If the web browser sends utf-8 in HTTP header
(environment variable HTTP_ACCEPT_CHARSET)
web2ldap directly works with UTF-8 bypassing all character
conversions.
For running as CGI-BIN:
-
Web server with CGI-BIN support, e.g.
For using SSL and client certificates:
-
OpenSSL for issueing the
certificates.
-
Apache SSL or
Apache with mod_ssl
(use "SSLOptions +CompatEnvVars" in httpd.conf!)
Ready-to-use packages of the required software in current Linux distributions:
-
The Linux distribution S.u.S.E.
already has packages of Python, OpenLDAP, OpenSSL, Apache with mod_ssl and
ldapmodule (since 6.2) for Python.
-
Red Hat has included the Python
interpreter with their Linux distribution. You might consider to grab some
pre-packaged RPMs of OpenLDAP,
ldapmodule and web2ldap.
-
I was told by
Lorenzo M. Catucci
that the upcoming Debian-Release
(nickname Potato) will include packages of Python, OpenLDAP, OpenSSL and
ldapmodule for Python as well as ApacheSSL and Apache with mod_ssl.
Documentation to get the required LDAP stuff working:
Installing
-
Install all required software.
-
Edit cgi-bin/web2ldap.py:
-
Adjust the path to the python excutable.
- Edit cgi-bin/web2ldapcnf.py:
-
Add additional directories for Python path.
-
Adjust misc. parameters after reading the comments and the
documentation.
-
Adjust parameters for specific LDAP hosts.
-
Call
python sbin/compile.py
and
python -O sbin/compile.py
for compiling all
sources.
-
Put the Python modules under pylib/ anywhere in your Python path
or adjust the parameter pylibdirs
in web2ldapcnf.py (recommended) to add more module directories
to the Python path.
-
For a quick start as stand-alone web gateway
simply invoke the script cgi-bin/web2ldap.py.
Use option -h for getting a brief help text.
This will also compile all necessary modules.
(Under Unix you have to be root to bind to a port below 1024.)
Usage
You can just access the gateway through the appropriate
URL without any parameters.
After a login screen it presents a interactive interface which
covers every aspect of a regular LDAP client.
Or you want to have your own forms suitable for your special application e.g.
you want to add entries for a special object class with a set of particular
attributes or it is necessary to restrict the search to a special LDAP host
to make usage easier for the user.
You might want to use your own input form templates for adding persons,
server or location entries.
No problem, the web2ldap is designed to be very flexible.
Instead of using the build in search and input forms you can save the HTML
code, have a closer look at it and write your own nice designed HTML forms
which just call the CGI-BIN with the appropriate parameters.