142 lines
5.8 KiB
HTML
142 lines
5.8 KiB
HTML
|
|
<!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">
|
|
|
|
|
|
|
|
|
|
<h1><a name="sql_configuration_backends" id="sql_configuration_backends">SQL configuration backends</a></h1>
|
|
<div class="level1">
|
|
|
|
<p>
|
|
|
|
There is 3 types of <acronym title="Structured Query Language">SQL</acronym> configuration backends for LemonLDAP::NG :
|
|
</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>
|
|
<li class="level1"><div class="li"> <strong><acronym title="Database Interface">DBI</acronym></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/1.4/changeconfbackend.html" class="wikilink1" title="documentation:1.4:changeconfbackend">how to change configuration backend</a>.</div>
|
|
</li>
|
|
</ul>
|
|
|
|
</div>
|
|
<!-- SECTION "SQL configuration backends" [1-382] -->
|
|
<h2><a name="lemonldap-ngini_parameters" id="lemonldap-ngini_parameters">Lemonldap-ng.ini parameters</a></h2>
|
|
<div class="level2">
|
|
|
|
<p>
|
|
|
|
To use a <acronym title="Structured Query Language">SQL</acronym> backend, configure your <code>lemonldap-ng.ini</code> file (section configuration) :
|
|
</p>
|
|
<ul>
|
|
<li class="level1"><div class="li"> Choose <acronym title="Database Interface">DBI</acronym> type (RDBI, CDBI or <acronym title="Database Interface">DBI</acronym>)</div>
|
|
</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>
|
|
<!-- SECTION "Lemonldap-ng.ini parameters" [383-974] -->
|
|
<h2><a name="configure_your_sql_database" id="configure_your_sql_database">Configure your SQL database</a></h2>
|
|
<div class="level2">
|
|
|
|
</div>
|
|
<!-- SECTION "Configure your SQL database" [975-1015] -->
|
|
<h3><a name="sql_configuration" id="sql_configuration">SQL configuration</a></h3>
|
|
<div class="level3">
|
|
|
|
</div>
|
|
|
|
<h4><a name="rdbi" id="rdbi">RDBI</a></h4>
|
|
<div class="level4">
|
|
<pre class="code">
|
|
CREATE TABLE lmConfig (
|
|
cfgNum int(11) NOT NULL,
|
|
field varchar(255) NOT NULL DEFAULT '',
|
|
value longblob,
|
|
PRIMARY KEY (cfgNum,field)
|
|
);
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<h4><a name="cdbi" id="cdbi">CDBI</a></h4>
|
|
<div class="level4">
|
|
<pre class="code">
|
|
CREATE TABLE lmConfig (
|
|
cfgNum int not null primary key,
|
|
data longblob
|
|
);
|
|
</pre>
|
|
|
|
</div>
|
|
<!-- SECTION "SQL configuration" [1016-1341] -->
|
|
<h3><a name="grant_lemonldapng_access" id="grant_lemonldapng_access">Grant LemonLDAP::NG access</a></h3>
|
|
<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>
|
|
<span class="kw1">TO</span> lemonldap<span class="sy0">-</span>ng<span class="sy0">-</span>user@<span class="st0">'10.0.0.%'</span> <span class="kw1">IDENTIFIED</span> <span class="kw1">BY</span> <span class="st0">'myotherpassword'</span>;</pre>
|
|
|
|
</div>
|
|
<!-- SECTION "Grant LemonLDAP::NG access" [1342-] --></div><!-- closes <div class="dokuwiki export">--> |