lemonldap-ng/build/lemonldap-ng/doc/4.3-MySQL-configuration-backend.html
Clément Oudot 34ea9bacd1 Doc: add DBI
2010-03-22 14:41:35 +00:00

189 lines
4.9 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 7 December 2008), see www.w3.org" />
<title>Lemonldap::NG documentation:
4.3-MySQL-configuration-backend.html</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<style type="text/css">
/*<![CDATA[*/
body{
background: #ddd;
font-family: sans-serif;
font-size: 11pt;
padding: 0 50px;
}
div.main-content{
padding: 10px;
background: #fff;
border: 2px #ccc solid;
}
a{
text-decoration: none;
}
p.footer{
text-align: center;
margin: 5px 0 0 0;
}
.heading-1{
text-align: center;
color: orange;
font-variant: small-caps;
font-size: 20pt;
}
.heading-1-1{
color: orange;
font-size: 14pt;
border-bottom: 2px #ccc solid;
}
pre{
background: #eee;
border: 2px #ccc solid;
padding: 5px;
border-left: 10px #ccc solid;
}
ul.star li{
list-style-type: square;
}
/*]]>*/
</style>
</head>
<body>
<div class="main-content">
<h2 class="heading-1"><span id="HUseofMySQLforconfigurationstorage">Use of
MySQL for configuration storage</span></h2>
<p class="paragraph"></p>
<ul>
<li>
<a href="#HMySQLconfiguration">MySQL configuration</a>
<ul>
<li><a href="#HDatabasecreation">Database creation</a></li>
<li><a href="#HConfigurationtable">Configuration table</a></li>
</ul>
</li>
<li>
<a href="#HLemonLDAP3A3ANGconfiguration">LemonLDAP::NG
configuration</a>
<ul>
<li><a href="#HDefaultconfiguration">Default configuration</a></li>
<li><a href=
"#HOverrideconfigStorageforLemonLDAP3A3ANGmodules">Override
configStorage for LemonLDAP::NG modules</a></li>
</ul>
</li>
</ul>
<h3 class="heading-1-1"><span id="HMySQLconfiguration">MySQL
configuration</span></h3>
<p class="paragraph"></p><strong class="strong">Remark</strong>: we advice
to create a specific user/password in MySQL for LemonLDAP::NG, with rights
on ist database.
<h4 class="heading-1-1-1"><span id="HDatabasecreation">Database
creation</span></h4><br />
<br />
For example, create the database "lemonldap-ng" :<br />
<br />
<div class="code">
<pre>
# mysqladmin create lemonldap-ng
</pre>
</div>
<h4 class="heading-1-1-1"><span id="HConfigurationtable">Configuration
table</span></h4><br />
<br />
To store configuration, use this table creation instruction:<br />
<br />
<div class="code">
<pre>
CREATE TABLE lmConfig (
cfgNum <span class="java-object">int</span> not <span class=
"java-keyword">null</span> primary key,
locationRules text,
exportedHeaders text,
globalStorage text,
globalStorageOptions text,
macros text,
groups text,
portal text,
domain text,
ldapServer text,
ldapPort <span class="java-object">int</span>,
ldapBase text,
securedCookie <span class="java-object">int</span>,
cookieName text,
authentication text,
exportedVars text,
managerDn text,
managerPassword text,
whatToTrace text,
timeout <span class="java-object">int</span>
);
</pre>
</div>
<h3 class="heading-1-1"><span id=
"HLemonLDAP3A3ANGconfiguration">LemonLDAP::NG configuration</span></h3>
<h4 class="heading-1-1-1"><span id="HDefaultconfiguration">Default
configuration</span></h4>
<p class="paragraph"></p>You can set this directly in <strong class=
"strong">storage.conf</strong>:
<p class="paragraph"></p>
<div class="code">
<pre>
type = DBI
dbiChain = DBI:mysql:database=lemonldap-ng;host=1.2.3.4
dbiUser = lemonldap
dbiPassword = password
dbiTable = lmConfig
</pre>
</div>
<h4 class="heading-1-1-1"><span id=
"HOverrideconfigStorageforLemonLDAP3A3ANGmodules">Override configStorage
for LemonLDAP::NG modules</span></h4>
<p class="paragraph"></p>Edit for example <strong class=
"strong">portal/index.pl</strong> or <strong class=
"strong">handler/MyHandler.pm</strong>:
<div class="code">
<pre>
configStorage =&gt; {
type =&gt; <span class="java-quote">"DBI"</span>,
dbiChain =&gt; <span class="java-quote">"dbi:mysql:..."</span>,
dbiUser =&gt; <span class="java-quote">"lemonldap"</span>,
dbiPassword =&gt; <span class="java-quote">"password"</span>,
dbiTable =&gt; <span class="java-quote">"lmConfig"</span>,
},
</pre>
</div>
<p class="paragraph"></p>
</div>
<p class="footer"><a href="index.html">Index</a></p>
</body>
</html>