Use of MySQL for 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 "lemonldap-ng" :

# mysqladmin create lemonldap-ng

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
     );

LemonLDAP::NG configuration

Default configuration

You can set this directly in storage.conf:

type        = DBI
dbiChain    = DBI:mysql:database=lemonldap-ng;host=1.2.3.4
dbiUser     = lemonldap
dbiPassword = password
dbiTable    = lmConfig

Override configStorage for LemonLDAP::NG modules

Edit for example portal/index.pl or handler/MyHandler.pm:
configStorage => {
      type        => "DBI",
      dbiChain    => "dbi:mysql:...",
      dbiUser     => "lemonldap",
      dbiPassword => "password",
      dbiTable    => "lmConfig",
  },