EXAMPLE
INSTALLATION
The proposed example use a protected site named test.example.com. Non
authenticated users are redirected to auth.example.com.
PREREQ
Software
To use Lemonldap::NG, you have to run a LDAP
server and of course an Apache server compiled with mod-perl (version 1.3
or 2.x). Generaly, the version of Apache proposed with your Linux
distribution match, but some distributions used an experimental version of
mod_perl with Apache2 (mod_perl-1.99) which does not work with
Lemonldap::NG. With such distributions (like Debian-3.1), you have to use
Apache-1.3 or to use a mod_perl, CGI.pm and CGI/Cookie.pm backports
(www.backports.org package for Debian works fine).
Needed Perl
modules
Apache::Session, Net::LDAP, MIME::Base64, CGI,
LWP::UserAgent, Cache::Cache, DBI, XML::Simple, SOAP::Lite (only if you
want to use SOAP with the manager).
With Debian, use:
apt-get install libapache-session-perl libnet-ldap-perl libcache-cache-perl libdbi-perl perl-modules libwww-perl libcache-cache-perl libxml-simple-perl
# If you want to use SOAP with the manager:
apt-get install libsoap-lite-perl
BUILDING
Complete
install
$ tar xzf lemonldap-ng-*.tar.gz
$ cd lemonldap-ng-*
$ make && make test
$ sudo make install
$ make example
Debian
install
$ tar xzf lemonldap-ng-*.tar.gz
$ cd lemonldap-ng-*
$ debuild
$ sudo dpkg -i ../lemonldap-ng*.deb
You can also use the Debian repository :
EXAMPLE
CONFIGURATION
After build, you have a new file named
example/apache.conf. You just have to include this file in Apache
configuration:
# Apache-1.3: add this to httpd.conf
include /path/to/lemonldap-ng/source/example/apache.conf
# Apache-2.x:
include /path/to/lemonldap-ng/source/example/apache2.conf
# Debian Apache-1.3
ln -s /usr/share/doc/lemonldap-ng/example/apache.conf /etc/apache/conf.d/test.conf
# or with Apache-2.x
ln -s /usr/share/doc/lemonldap-ng/example/apache2.conf /etc/apache2/sites-enabled/test.conf
Modify your /etc/hosts file to include:
127.0.0.2 auth.example.com
127.0.0.3 test.example.com
127.0.0.4 manager.example.com
Now you have to edit configuration to set your
LDAP settings. You can either use :
- the manager interface: restart Apache and connect to http://manager.example.com/
- edit /path/to/lemonldap-ng/source/example/lmConfig-1 and specify
your LDAP settings (Debian users:
/usr/share/doc/lemonldap-ng/example/conf/lmConfig-1).
If you don't set managerDn and managerPassword, Lemonldap::NG will
use an anonymous bind to find user dn.
WARNINGS:
- only few parameters can be set by hand in the configuration file.
You have to use the manager to change configuration, but since the
example is yet configured, you can edit directly the file,
- each new configuration is saved by the manager in a new file (or a
new record with DBI) so you can recover an old configuration by removing
the new one.
Next, restart Apache and use your prefered browser and try to connect
to
http://test.example.com/. You'll be
redirect to auth.example.com. Try to authenticate yourself with a valid
account and the protected page will appear.