Use of MySQL for sessions and/or configuration storage
MySQL configuration
Remark: we advice to create a specific user/password in MySQL for LemonLDAP::NG, with rights on ist database.Database creation
For example, create the database "lemonldapng" :
# mysqladmin create lemonldapng
Configuration table
To store configuration, use this table creation instruction:
CREATE TABLE lmConfig ( cfgNum int not null primary key, locationRules text, exportedHeaders text, globalStorage text, globalStorageOptions text, macros text, groups text, portal text, domain text, ldapServer text, ldapPort int, ldapBase text, securedCookie int, cookieName text, authentication text, exportedVars text, managerDn text, managerPassword text, whatToTrace text, timeout int );
Session table
The choice of Apache::Session::* module is free. See Apache::Session::Store::* or Apache::Session::* to know how to configure the module. If you want to use Apache::Session::MySQL, you can create the database like this:
CREATE TABLE sessions (
id char(32),
a_session text
);
LemonLDAP::NG configuration
Set configStorage for LemonLDAP::NG modules
By default, configStorage use the "File" backend, like:configStorage => { type => "File", dirName => "/etc/lemonldap-ng/conf/", },
configStorage => { type => "DBI", dbiChain => "dbi:mysql:...", dbiUser => "lemonldap", dbiPassword => "password", dbiTable => "lmConfig", },
Set Apache::Session backend
Go to the Manager and go in General Parameters > Session Storage. Then change Apache::Session module to "Apache::Session::MySQL" and in Apache::Session parameters configure the following options:- DataSource (for example: DBI:mysql:database=lemonldapng;host=127.0.0.1)
- UserName
- Password
- TableName
- LockDataSource
- LockUserName
- LockPassword
globalStorage => "Apache::Session::MySQL", globalStorageOptions => { DataSource => "dbi:mysql:database=lemonldapng;host=127.0.0.1", UserName => "db_user", Password => "db_password", TableName => "sessions", LockDataSource => "dbi:mysql:database=lemonldapng;host=127.0.0.1", LockUserName => "db_user", LockPassword => "db_password", },