LemonLDAP::NG configuration is stored in a backend that allows all modules to access it.
Detailled configuration backends documentation is available here.
By default, configuration is stored in files, so access trough network is not possible. To allow this, use SOAP for configuration access, or use a network service like SQL database or LDAP directory.
Configuration backend can be set in the local configuration file, in configuration
section.
For example, to configure the File
configuration backend:
[configuration] type=File dirName = /usr/local/lemonldap-ng/data/conf
Most of configuration can be done trough LemonLDAP::NG Manager (by default http://manager.example.com).
By default, Manager is protected to allow only the demonstration user “dwho”.
If you can not access the Manager anymore, you can unprotect it by editing lemonldap-ng.in
and changing the protection
parameter:
[manager]
# Manager protection: by default, the manager is protected by a demo account.
# You can protect it :
# * by Apache itself,
# * by the parameter 'protection' which can take one of the following
# values :
# * authenticate : all authenticated users can access
# * manager : manager is protected like other virtual hosts: you
# have to set rules in the corresponding virtual host
# * rule: <rule> : you can set here directly the rule to apply
# * none : no protection
The Manager displays main branches:
LemonLDAP::NG configuration is mainly a key/value structure, so Manager will present all keys into a structured tree. A click on a key will display the associated value.
Apply
button if available, to be sure the value is saved.
When all modifications are done, click on Save
to store configuration.
You can change the graphical aspect of the Manager, by clicking on the Menu style
button. It will open a dialog to choose:
lemonldap-ng.ini
, section manager
:
LemonLDAP::NG provide a script that allows to edit configuration without graphical interface, this script is called lmConfigEditor
and is stored in the LemonLDAP::NG bin/ directory, for example /usr/share/lemonldap-ng/bin:
/usr/share/lemonldap-ng/bin/lmConfigEditor
The script uses the editor
system command, that links to your favorite editor. To change it:
update-alternatives --config editor
The configuration is displayed as a big Perl Hash, that you can edit:
$VAR1 = { 'ldapAuthnLevel' => '2', 'notificationWildcard' => 'allusers', 'loginHistoryEnabled' => '1', 'key' => 'q`e)kJE%<&wm>uaA', 'samlIDPSSODescriptorSingleSignOnServiceHTTPPost' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST;#PORTAL#/saml/singleSignOn;', 'portalSkin' => 'pastel', 'failedLoginNumber' => '5', ... };
If a modification is done, the configuration is saved with a new configuration number. Else, current configuration is kept.
LemonLDAP::NG ships 3 Apache configuration files:
These files must be included in Apache configuration, either with Include
directives in httpd.conf
(see quick start example), or with symbolic links in Apache configuration directory (like /etc/httpd/conf.d
).
LoadModule
directive.
In Portal virtual host, you will find several configuration parts:
ServerName auth.example.com # DocumentRoot DocumentRoot /usr/local/lemonldap-ng/htdocs/portal/ <Directory /usr/local/lemonldap-ng/htdocs/portal/> Order allow,deny Allow from all Options +ExecCGI </Directory> # Perl script <Files *.pl> SetHandler perl-script PerlResponseHandler ModPerl::Registry </Files> # Directory index <IfModule mod_dir.c> DirectoryIndex index.pl index.html </IfModule>
# SOAP functions for sessions management (disabled by default) <Location /index.pl/adminSessions> Order deny,allow Deny from all </Location> # SOAP functions for sessions access (disabled by default) <Location /index.pl/sessions> Order deny,allow Deny from all </Location> # SOAP functions for configuration access (disabled by default) <Location /index.pl/config> Order deny,allow Deny from all </Location> # SOAP functions for notification insertion (disabled by default) <Location /index.pl/notification> Order deny,allow Deny from all </Location>
mod_rewrite
):# SAML2 Issuer <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^/saml/metadata /metadata.pl RewriteRule ^/saml/.* /index.pl </IfModule> # CAS Issuer <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^/cas/.* /index.pl </IfModule> # OpenID Issuer <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^/openidserver/.* /index.pl </IfModule>
# Best performance under ModPerl::Registry # Uncomment this to increase performance of Portal <Perl> require Lemonldap::NG::Portal::SharedConf; Lemonldap::NG::Portal::SharedConf->compile( qw(delete header cache read_from_client cookie redirect unescapeHTML)); # Uncomment this line if you use Lemonldap::NG menu require Lemonldap::NG::Portal::Menu; # Uncomment this line if you use portal SOAP capabilities require SOAP::Lite; </Perl>
Manager virtual host is used to serve configuration interface and local documentation.
lemonldap-ng.ini
):DocumentRoot /usr/local/lemonldap-ng/htdocs/manager/ <Directory /usr/local/lemonldap-ng/htdocs/manager/> Order deny,allow Allow from all Options +ExecCGI </Directory>
Alias /doc/ /usr/local/lemonldap-ng/htdocs/doc/ <Directory /usr/local/lemonldap-ng/htdocs/doc/> Order deny,allow Allow from all </Directory>
PerlOptions +GlobalRequest PerlRequire /usr/local/lemonldap-ng/handler/MyHandler.pm
ErrorDocument 403 http://auth.example.com/?lmError=403 ErrorDocument 500 http://auth.example.com/?lmError=500 ErrorDocument 503 http://auth.example.com/?lmError=503
<VirtualHost *:80> ServerName reload.example.com # Configuration reload mechanism (only 1 per physical server is # needed): choose your URL to avoid restarting Apache when # configuration change <Location /reload> Order deny,allow Deny from all Allow from 127.0.0.0/8 PerlHeaderParserHandler My::Package->refresh </Location> # Uncomment this to activate status module #<Location /status> # Order deny,allow # Deny from all # Allow from 127.0.0.0/8 # PerlHeaderParserHandler My::Package->status #</Location> </VirtualHost>
Then, to protect a standard virutal host, the only configuration line to add is:
PerlHeaderParserHandler My::Package
After configuration is saved by Manager, LemonLDAP::NG will try to reload configuration on distant Handlers by sending an HTTP request to the servers. The servers and URLs can be configured in Manager, General Parameters
> reload configuration URLs
: keys are server names or IP the requests will be sent to, and values are the requested URLs.
These parameters can be overwritten in LemonLDAP::NG ini file, in the section apply
.
The reload
target is managed in Apache configuration, inside a virtual host protected by LemonLDAP::NG Handler, for example:
<VirtualHost *:80> ServerName reload.example.com <Location /reload> Order deny,allow Deny from all Allow from 127.0.0.0/8 PerlHeaderParserHandler My::Package->refresh </Location> </VirtualHost>
LemonLDAP::NG configuration can be managed in a local file with INI format. This file is called lemonldap-ng.ini
and has the following sections:
When you set a parameter in lemonldap-ng.ini
, it will override the parameter from the global configuration.
For example, to override configured skin for portal:
[portal] portalSkin = dark
LemonLDAP::NG allows to override any configuration parameter directly in script file. However, it is not advised to edit such files, as they are part of the program, and will be erased at next upgrade.
For example, in portal/index.pl:
my $portal = Lemonldap::NG::Portal::SharedConf->new( { portalSkin => 'dark', } );
For example, in handler/MyHandler.pm:
__PACKAGE__->init( { domain => 'acme.com', } );