Lemonldap::NG::Handler::SharedConf - Perl extension for adding dynamic configuration to Lemonldap::NG::Handler::Simple. To use for inheritance.
package My::Package; use Lemonldap::NG::Handler::SharedConf; @ISA = qw(Lemonldap::NG::Handler::SharedConf); sub getConf { # Write here your configuration download system # It has to return a hash reference containing # global configuration variables: # { # locationRules => { '^/.*$' => '$ou =~ /brh/'}, # globalStorage => 'Apache::Session::MySQL', # globalStorageOptions => { # ... # } # portal => 'https://portal/', # } # See L<Lemonldap::NG::Handler::Simple> for more } __PACKAGE__->init ( { localStorage => "Cache::DBFile", localStorageOptions => {}, reloadTime => 1200, # Default: 600 } );
The configuration is loaded only at Apache start. Create an URI to force configuration reload, so you don't need to restart Apache at each change :
# <apache>/conf/httpd.conf <Location /location/that/I/ve/choosed> Order deny,allow Deny from all Allow from my.manager.com PerlInitHandler My::Package->refresh </Location>
This library splits Lemonldap::NG::Handler::Simple initialization into 2 phases: local initialization and global configuration set. It can be used if you want to write a module that can change its global configuration without restarting Apache and that use a central configuration storage (like DBI, see Lemonldap::NG::SharedConf::DBI).
Like Lemonldap::NG::Handler::Simple::init() but read only localStorage related options. You may change default time between two configuration checks with the reloadTime parameter (default 600s).
reloadTime
Does nothing by default. You've to overload it to write your own configuration download system.
Same as Lemonldap::NG::Handler::Simple.
Each new Apache child checks if there's a configuration stored in the local store. If not, it calls getConf to get one and store it in the local store by calling setconf.
Every 600 seconds, each Apache child checks if the local stored configuration has changed and reload it if it has.
When refresh subroutine is called (by http for example: see synopsis), getConf is called to get the new configuration and setconf is called to store it in the local store.
Lemonldap::NG::Handler, Lemonldap::NG::Handler::SharedConf::DBI
Xavier Guimard, <x.guimard@free.fr>
Copyright (C) 2005 by Xavier Guimard <x.guimard@free.fr>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
=back without =over
To install Lemonldap::NG::Handler::Vhost, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lemonldap::NG::Handler::Vhost
CPAN shell
perl -MCPAN -e shell install Lemonldap::NG::Handler::Vhost
For more information on module installation, please visit the detailed CPAN module installation guide.