2012-02-25 23:45:20 +01:00
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "en"
lang="en" dir="ltr">
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< title > < / title >
<!-- metadata -->
< meta name = "generator" content = "Offline" / >
< meta name = "version" content = "Offline 0.1" / >
<!-- style sheet links -->
< link rel = "stylesheet" media = "all" type = "text/css" href = "../../../css/all.css" / >
< link rel = "stylesheet" media = "screen" type = "text/css" href = "../../../css/screen.css" / >
< link rel = "stylesheet" media = "print" type = "text/css" href = "../../../css/print.css" / >
< / head >
< body >
< div class = "dokuwiki export" >
2015-06-08 16:57:58 +02:00
< h1 class = "sectionedit1" id = "sql_configuration_backends" > SQL configuration backends< / h1 >
2012-02-25 23:45:20 +01:00
< div class = "level1" >
< p >
2015-06-08 16:57:58 +02:00
There is 3 types of SQL configuration backends for LemonLDAP::NG :
2012-02-25 23:45:20 +01:00
< / p >
< ul >
< li class = "level1" > < div class = "li" > < strong > CDBI< / strong > : very simple storage< / div >
< / li >
< li class = "level1" > < div class = "li" > < strong > RDBI< / strong > : triple store storage< / div >
< / li >
2016-03-22 12:19:17 +01:00
< li class = "level1" > < div class = "li" > < strong > < abbr title = "Database Interface" > DBI< / abbr > < / strong > which has been deprecated: it is a read-only backend that exists just for compatibility with older versions of LemonLDAP::NG. See < a href = "../../documentation/2.0/changeconfbackend.html" class = "wikilink1" title = "documentation:2.0:changeconfbackend" > how to change configuration backend< / a > .< / div >
2012-02-25 23:45:20 +01:00
< / li >
< / ul >
< / div >
2015-06-08 16:57:58 +02:00
<!-- EDIT1 SECTION "SQL configuration backends" [1 - 382] -->
< h2 class = "sectionedit2" id = "lemonldap-ngini_parameters" > Lemonldap-ng.ini parameters< / h2 >
2012-02-25 23:45:20 +01:00
< div class = "level2" >
< p >
2015-06-08 16:57:58 +02:00
To use a SQL backend, configure your < code > lemonldap-ng.ini< / code > file (section configuration) :
2012-02-25 23:45:20 +01:00
< / p >
< ul >
2015-06-08 16:57:58 +02:00
< li class = "level1" > < div class = "li" > Choose < abbr title = "Database Interface" > DBI< / abbr > type (RDBI, CDBI or < abbr title = "Database Interface" > DBI< / abbr > )< / div >
2012-02-25 23:45:20 +01:00
< / li >
< li class = "level1" > < div class = "li" > Configure the connection string (see < a href = "http://search.cpan.org/perldoc?DBI" class = "urlextern" title = "http://search.cpan.org/perldoc?DBI" rel = "nofollow" > DBI manual page< / a > )< / div >
< / li >
< li class = "level1" > < div class = "li" > Configure user and password< / div >
< / li >
< li class = "level1" > < div class = "li" > If your table is not named lmConfig, set it' s name in < code > dbiTable< / code > parameter.< / div >
< / li >
< / ul >
< p >
Example for MySQL :
< / p >
< pre class = "code ini" > < span class = "re0" > < span class = "br0" > [ < / span > configuration< span class = "br0" > ] < / span > < / span >
< span class = "re1" > type< / span > < span class = "sy0" > =< / span > < span class = "re2" > RDBI< / span >
< span class = "re1" > dbiChain< / span > < span class = "sy0" > =< / span > < span class = "re2" > DBI:mysql:database=lemonldap-ng< / span > < span class = "co0" > ;host=1.2.3.4< / span >
< span class = "re1" > dbiUser< / span > < span class = "sy0" > =< / span > < span class = "re2" > lemonldap< / span >
< span class = "re1" > dbiPassword< / span > < span class = "sy0" > =< / span > < span class = "re2" > password< / span >
< span class = "co0" > ; optional< / span >
< span class = "re1" > dbiTable< / span > < span class = "sy0" > =< / span > < span class = "re2" > mytablename< / span > < / pre >
< / div >
2015-06-08 16:57:58 +02:00
<!-- EDIT2 SECTION "Lemonldap - ng.ini parameters" [383 - 974] -->
< h2 class = "sectionedit3" id = "configure_your_sql_database" > Configure your SQL database< / h2 >
2012-02-25 23:45:20 +01:00
< div class = "level2" >
< / div >
2015-06-08 16:57:58 +02:00
<!-- EDIT3 SECTION "Configure your SQL database" [975 - 1015] -->
< h3 class = "sectionedit4" id = "sql_configuration" > SQL configuration< / h3 >
2012-02-25 23:45:20 +01:00
< div class = "level3" >
< / div >
2015-06-08 16:57:58 +02:00
< h4 id = "rdbi" > RDBI< / h4 >
2012-02-25 23:45:20 +01:00
< div class = "level4" >
2016-02-10 11:17:35 +01:00
< pre class = "code sql" > < span class = "kw1" > CREATE< / span > < span class = "kw1" > TABLE< / span > lmConfig < span class = "br0" > ( < / span >
cfgNum < span class = "kw1" > INT< / span > < span class = "br0" > ( < / span > < span class = "nu0" > 11< / span > < span class = "br0" > ) < / span > < span class = "kw1" > NOT< / span > < span class = "kw1" > NULL< / span > < span class = "sy0" > ,< / span >
< span class = "kw1" > FIELD< / span > < span class = "kw1" > VARCHAR< / span > < span class = "br0" > ( < / span > < span class = "nu0" > 255< / span > < span class = "br0" > ) < / span > < span class = "kw1" > NOT< / span > < span class = "kw1" > NULL< / span > < span class = "kw1" > DEFAULT< / span > < span class = "st0" > ''< / span > < span class = "sy0" > ,< / span >
< span class = "kw1" > VALUE< / span > longblob< span class = "sy0" > ,< / span >
< span class = "kw1" > PRIMARY< / span > < span class = "kw1" > KEY< / span > < span class = "br0" > ( < / span > cfgNum< span class = "sy0" > ,< / span > < span class = "kw1" > FIELD< / span > < span class = "br0" > ) < / span >
< span class = "br0" > ) < / span > ;< / pre >
2012-02-25 23:45:20 +01:00
< / div >
2015-06-08 16:57:58 +02:00
< h4 id = "cdbi" > CDBI< / h4 >
2012-02-25 23:45:20 +01:00
< div class = "level4" >
2016-02-10 11:17:35 +01:00
< pre class = "code sql" > < span class = "kw1" > CREATE< / span > < span class = "kw1" > TABLE< / span > lmConfig < span class = "br0" > ( < / span >
cfgNum < span class = "kw1" > INT< / span > < span class = "kw1" > NOT< / span > < span class = "kw1" > NULL< / span > < span class = "kw1" > PRIMARY< / span > < span class = "kw1" > KEY< / span > < span class = "sy0" > ,< / span >
< span class = "kw1" > DATA< / span > longblob
< span class = "br0" > ) < / span > ;< / pre >
2012-02-25 23:45:20 +01:00
< / div >
2016-02-10 11:17:35 +01:00
<!-- EDIT4 SECTION "SQL configuration" [1016 - 1349] -->
2015-06-08 16:57:58 +02:00
< h3 class = "sectionedit5" id = "grant_lemonldapng_access" > Grant LemonLDAP::NG access< / h3 >
2012-02-25 23:45:20 +01:00
< div class = "level3" >
< p >
You have to grant read/write access for the manager component. Other components needs just a read access. You can also use the same user for all.
< / p >
< p >
< p > < div class = "notetip" > You can use different dbiUser strings :
< / p >
< ul >
< li class = "level1" > < div class = "li" > one with read/write rights for servers hosting the manager< / div >
< / li >
< li class = "level1" > < div class = "li" > one with just read rights for other servers< / div >
< / li >
< / ul >
< p >
< / div > < / p >
< / p >
< p >
MySQL example (suppose that our servers are in 10.0.0.0/24 network):
< / p >
< pre class = "code sql" > < span class = "kw1" > GRANT< / span > < span class = "kw1" > SELECT< / span > < span class = "sy0" > ,< / span > < span class = "kw1" > INSERT< / span > < span class = "sy0" > ,< / span > < span class = "kw1" > UPDATE< / span > < span class = "sy0" > ,< / span > < span class = "kw1" > LOCK< / span > < span class = "kw1" > TABLES< / span > < span class = "kw1" > ON< / span > lmConfig< span class = "sy0" > .*< / span >
< span class = "kw1" > TO< / span > lemonldap< span class = "sy0" > -< / span > ng@manager< span class = "sy0" > .< / span > host < span class = "kw1" > IDENTIFIED< / span > < span class = "kw1" > BY< / span > < span class = "st0" > 'mypassword'< / span > ;
< span class = "kw1" > GRANT< / span > < span class = "kw1" > SELECT< / span > < span class = "kw1" > ON< / span > lmConfig< span class = "sy0" > .*< / span >
2015-06-08 16:57:58 +02:00
< span class = "kw1" > TO< / span > lemonldap< span class = "sy0" > -< / span > ng< span class = "sy0" > -< / span > < span class = "kw1" > USER< / span > @< span class = "st0" > '10.0.0.%'< / span > < span class = "kw1" > IDENTIFIED< / span > < span class = "kw1" > BY< / span > < span class = "st0" > 'myotherpassword'< / span > ;< / pre >
2012-02-25 23:45:20 +01:00
< / div >
2015-06-08 16:57:58 +02:00
< / div > <!-- closes <div class="dokuwiki export"> -->