# Installation on RedHat/CentOS

## RPMs organization

LemonLDAP::NG provides many RPMs :

- lemonldap-ng: meta-package, contains no file but dependencies on other packages
- lemonldap-ng-doc: contains HTML documentation and project docs (README, etc.)
- lemonldap-ng-conf: contains default configuration (DNS domain: example.com)
- lemonldap-ng-test: contains sample CGI test page
- lemonldap-ng-handler: contains Apache Handler implementation (agent)
- lemonldap-ng-manager: contains administration interface and session explorer
- lemonldap-ng-portal: contains authentication portal and menu
- perl-Lemonldap-NG-Common: CPAN - Shared modules
- perl-Lemonldap-NG-Handler: CPAN - Handler modules
- perl-Lemonldap-NG-Manager: CPAN - Manager modules
- perl-Lemonldap-NG-Portal: CPAN - Portal modules

This schema shows the dependencies between modules:

## Get the packages

For now, RPMS are only available on the Download page.

## Build your packages

If you need it, you can rebuild RPMs:

- Install rpm-build package
- Install all build dependencies (see BuildRequires in lemonldap-ng.spec)
- Put lemonldap-ng.spec in %_topdir/SPECS
- Put LemonLDAP::NG tarball in %_topdir/SOURCES
- Edit ~/.rpmmacros and set your build parameters (example for RHEL5):

    %_topdir /home/user/build
    %dist .el5
    %rhel 5

- Go to %_topdir
- Build:

    $ rpmbuild -ba SPECS/lemonldap-ng.spec

## Package GPG signature

The GPG key can be downloaded here: rpm-gpg-key-ow2

Install it to trust RPMs:

    # rpm --import rpm-gpg-key-ow2

## Install packages with yum

If the packages are stored in a yum repository:

    # yum install lemonldap-ng

You can also use yum on local RPMs file, to manage dependencies:

    # yum install lemonldap-ng-* perl-Lemonldap-NG-*

## Install packages with rpm

Before installing the packages, install dependencies.

You have then to install all the downloaded packages:

    # rpm -Uvh lemonldap-ng-* perl-Lemonldap-NG-*

## Install just one component

You can choose to install only one component by choosing the package lemonldap-ng-portal, lemonldap-ng-handler or lemonldap-ng-manager. Install the package lemonldap-ng-conf only on the server which stores configuration.

## File location

- Configuration is in /etc/lemonldap-ng
- LemonLDAP::NG configuration (edited by the Manager) is in /var/lib/lemonldap-ng/conf/
- All Perl modules are in the VENDOR perl directory
- All Perl scripts/pages are in /var/lib/lemonldap-ng/
- All static content (examples, CSS, images, etc.) is in /usr/share/lemonldap-ng/

## Change default DNS domain

By default, DNS domain is `example.com`. You can change it quick with a sed command. For example, we change it to `ow2.org`:

    # sed -i 's/example\.com/ow2.org/g' /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1 /var/lib/lemonldap-ng/test/index.pl