diff options
Diffstat (limited to '')
-rw-r--r-- | docs/manual/mod/mod_dbd.html | 9 | ||||
-rw-r--r-- | docs/manual/mod/mod_dbd.html.en | 394 | ||||
-rw-r--r-- | docs/manual/mod/mod_dbd.html.fr.utf8 | 421 |
3 files changed, 824 insertions, 0 deletions
diff --git a/docs/manual/mod/mod_dbd.html b/docs/manual/mod/mod_dbd.html new file mode 100644 index 0000000..f12f459 --- /dev/null +++ b/docs/manual/mod/mod_dbd.html @@ -0,0 +1,9 @@ +# GENERATED FROM XML -- DO NOT EDIT + +URI: mod_dbd.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 + +URI: mod_dbd.html.fr.utf8 +Content-Language: fr +Content-type: text/html; charset=UTF-8 diff --git a/docs/manual/mod/mod_dbd.html.en b/docs/manual/mod/mod_dbd.html.en new file mode 100644 index 0000000..e695743 --- /dev/null +++ b/docs/manual/mod/mod_dbd.html.en @@ -0,0 +1,394 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!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="en" xml:lang="en"><head> +<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>mod_dbd - Apache HTTP Server Version 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body> +<div id="page-header"> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> +<p class="apache">Apache HTTP Server Version 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">Modules</a></div> +<div id="page-content"> +<div id="preamble"><h1>Apache Module mod_dbd</h1> +<div class="toplang"> +<p><span>Available Languages: </span><a href="../en/mod/mod_dbd.html" title="English"> en </a> | +<a href="../fr/mod/mod_dbd.html" hreflang="fr" rel="alternate" title="Français"> fr </a></p> +</div> +<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Manages SQL database connections</td></tr> +<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>dbd_module</td></tr> +<tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_dbd.c</td></tr> +<tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.1 and later</td></tr></table> +<h3>Summary</h3> + + <p><code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> manages SQL database connections using + <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a>. It provides database connections on request + to modules requiring SQL database functions, and takes care of + managing databases with optimal efficiency and scalability + for both threaded and non-threaded MPMs. For details, see the + <a href="http://apr.apache.org/">APR</a> website and this overview of the + <a href="http://people.apache.org/~niq/dbd.html">Apache DBD Framework</a> + by its original developer. +</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3>Topics</h3> +<ul id="topics"> +<li><img alt="" src="../images/down.gif" /> <a href="#pooling">Connection Pooling</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#connecting">Connecting</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#API">Apache DBD API</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#prepared">SQL Prepared Statements</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#security">SECURITY WARNING</a></li> +</ul><h3 class="directives">Directives</h3> +<ul id="toc"> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdexptime">DBDExptime</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdinitsql">DBDInitSQL</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdkeep">DBDKeep</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdmax">DBDMax</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdmin">DBDMin</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdparams">DBDParams</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdpersist">DBDPersist</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdpreparesql">DBDPrepareSQL</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdriver">DBDriver</a></li> +</ul> +<h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&list_id=144532&product=Apache%20httpd-2&query_format=specific&order=changeddate%20DESC%2Cpriority%2Cbug_severity&component=mod_dbd">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&component=mod_dbd">Report a bug</a></li></ul><h3>See also</h3> +<ul class="seealso"> +<li><a href="../misc/password_encryptions.html">Password Formats</a></li> +<li><a href="#comments_section">Comments</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="pooling" id="pooling">Connection Pooling</a></h2> + <p>This module manages database connections, in a manner + optimised for the platform. On non-threaded platforms, + it provides a persistent connection in the manner of + classic LAMP (Linux, Apache, Mysql, Perl/PHP/Python). + On threaded platform, it provides an altogether more + scalable and efficient <em>connection pool</em>, as + described in <a href="http://www.apachetutor.org/dev/reslist">this + article at ApacheTutor</a>. Note that <code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> + supersedes the modules presented in that article.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="connecting" id="connecting">Connecting</a></h2> + + <p>To connect to your database, you'll need to specify + a driver, and connection parameters. These vary from + one database engine to another. For example, to connect + to mysql, do the following:</p> + +<pre class="prettyprint lang-config">DBDriver mysql +DBDParams host=localhost,dbname=pony,user=shetland,pass=appaloosa</pre> + + + <p>You can then use this connection in a variety of other + modules, including <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>, + <code class="module"><a href="../mod/mod_authn_dbd.html">mod_authn_dbd</a></code>, and <code class="module"><a href="../mod/mod_lua.html">mod_lua</a></code>. + Further usage examples appear in each of those modules' + documentation.</p> + + <p>See <code class="directive">DBDParams</code> for connection string + information for each of the supported database drivers.</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="API" id="API">Apache DBD API</a></h2> + <p><code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> exports five functions for other modules + to use. The API is as follows:</p> + +<pre class="prettyprint lang-c">typedef struct { + apr_dbd_t *handle; + apr_dbd_driver_t *driver; + apr_hash_t *prepared; +} ap_dbd_t; + +/* Export functions to access the database */ + +/* acquire a connection that MUST be explicitly closed. + * Returns NULL on error + */ +AP_DECLARE(ap_dbd_t*) ap_dbd_open(apr_pool_t*, server_rec*); + +/* release a connection acquired with ap_dbd_open */ +AP_DECLARE(void) ap_dbd_close(server_rec*, ap_dbd_t*); + +/* acquire a connection that will have the lifetime of a request + * and MUST NOT be explicitly closed. Return NULL on error. + * This is the preferred function for most applications. + */ +AP_DECLARE(ap_dbd_t*) ap_dbd_acquire(request_rec*); + +/* acquire a connection that will have the lifetime of a connection + * and MUST NOT be explicitly closed. Return NULL on error. + */ +AP_DECLARE(ap_dbd_t*) ap_dbd_cacquire(conn_rec*); + +/* Prepare a statement for use by a client module */ +AP_DECLARE(void) ap_dbd_prepare(server_rec*, const char*, const char*); + +/* Also export them as optional functions for modules that prefer it */ +APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_open, (apr_pool_t*, server_rec*)); +APR_DECLARE_OPTIONAL_FN(void, ap_dbd_close, (server_rec*, ap_dbd_t*)); +APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_acquire, (request_rec*)); +APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_cacquire, (conn_rec*)); +APR_DECLARE_OPTIONAL_FN(void, ap_dbd_prepare, (server_rec*, const char*, const char*));</pre> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="prepared" id="prepared">SQL Prepared Statements</a></h2> + <p><code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> supports SQL prepared statements on behalf + of modules that may wish to use them. Each prepared statement + must be assigned a name (label), and they are stored in a hash: + the <code>prepared</code> field of an <code>ap_dbd_t</code>. + Hash entries are of type <code>apr_dbd_prepared_t</code> + and can be used in any of the apr_dbd prepared statement + SQL query or select commands.</p> + + <p>It is up to dbd user modules to use the prepared statements + and document what statements can be specified in httpd.conf, + or to provide their own directives and use <code>ap_dbd_prepare</code>.</p> + + <div class="warning"><h3>Caveat</h3> + When using prepared statements with a MySQL database, it is preferred to set + <code>reconnect</code> to 0 in the connection string as to avoid errors that + arise from the MySQL client reconnecting without properly resetting the + prepared statements. If set to 1, any broken connections will be attempted + fixed, but as mod_dbd is not informed, the prepared statements will be invalidated. + </div> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="security" id="security">SECURITY WARNING</a></h2> + + <p>Any web/database application needs to secure itself against SQL + injection attacks. In most cases, Apache DBD is safe, because + applications use prepared statements, and untrusted inputs are + only ever used as data. Of course, if you use it via third-party + modules, you should ascertain what precautions they may require.</p> + <p>However, the <var>FreeTDS</var> driver is inherently + <strong>unsafe</strong>. The underlying library doesn't support + prepared statements, so the driver emulates them, and the + untrusted input is merged into the SQL statement.</p> + <p>It can be made safe by <em>untainting</em> all inputs: + a process inspired by Perl's taint checking. Each input + is matched against a regexp, and only the match is used, + according to the Perl idiom:</p> + <div class="example"><pre><code> $untrusted =~ /([a-z]+)/; + $trusted = $1;</code></pre></div> + <p>To use this, the untainting regexps must be included in the + prepared statements configured. The regexp follows immediately + after the % in the prepared statement, and is enclosed in + curly brackets {}. For example, if your application expects + alphanumeric input, you can use:</p> + <div class="example"><p><code> + <code>"SELECT foo FROM bar WHERE input = %s"</code> + </code></p></div> + <p>with other drivers, and suffer nothing worse than a failed query. + But with FreeTDS you'd need:</p> + <div class="example"><p><code> + <code>"SELECT foo FROM bar WHERE input = %{([A-Za-z0-9]+)}s"</code> + </code></p></div> + <p>Now anything that doesn't match the regexp's $1 match is + discarded, so the statement is safe.</p> + <p>An alternative to this may be the third-party ODBC driver, + which offers the security of genuine prepared statements.</p> +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="DBDExptime" id="DBDExptime">DBDExptime</a> <a name="dbdexptime" id="dbdexptime">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Keepalive time for idle connections</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDExptime <var>time-in-seconds</var></code></td></tr> +<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DBDExptime 300</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Set the time to keep idle connections alive when the number + of connections specified in DBDKeep has been exceeded (threaded + platforms only).</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="DBDInitSQL" id="DBDInitSQL">DBDInitSQL</a> <a name="dbdinitsql" id="dbdinitsql">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Execute an SQL statement after connecting to a database</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDInitSQL <var>"SQL statement"</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Modules, that wish it, can have one or more SQL statements + executed when a connection to a database is created. Example + usage could be initializing certain values or adding a log + entry when a new connection is made to the database.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="DBDKeep" id="DBDKeep">DBDKeep</a> <a name="dbdkeep" id="dbdkeep">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum sustained number of connections</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDKeep <var>number</var></code></td></tr> +<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DBDKeep 2</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Set the maximum number of connections per process to be + sustained, other than for handling peak demand (threaded + platforms only).</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="DBDMax" id="DBDMax">DBDMax</a> <a name="dbdmax" id="dbdmax">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum number of connections</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDMax <var>number</var></code></td></tr> +<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DBDMax 10</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Set the hard maximum number of connections per process + (threaded platforms only).</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="DBDMin" id="DBDMin">DBDMin</a> <a name="dbdmin" id="dbdmin">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Minimum number of connections</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDMin <var>number</var></code></td></tr> +<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DBDMin 1</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Set the minimum number of connections per process (threaded + platforms only).</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="DBDParams" id="DBDParams">DBDParams</a> <a name="dbdparams" id="dbdparams">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Parameters for database connection</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDParams +<var>param1</var>=<var>value1</var>[,<var>param2</var>=<var>value2</var>]</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>As required by the underlying driver. Typically this will be + used to pass whatever cannot be defaulted amongst username, + password, database name, hostname and port number for connection.</p> + <p>Connection string parameters for current drivers include:</p> + <dl> + <dt>FreeTDS (for MSSQL and SyBase)</dt> + <dd>username, password, appname, dbname, host, charset, lang, server</dd> + <dt>MySQL</dt> + <dd>host, port, user, pass, dbname, sock, flags, fldsz, group, reconnect</dd> + <dt>Oracle</dt> + <dd>user, pass, dbname, server</dd> + <dt>PostgreSQL</dt> + <dd>The connection string is passed straight through to <code>PQconnectdb</code></dd> + <dt>SQLite2</dt> + <dd>The connection string is split on a colon, and <code>part1:part2</code> is used as <code>sqlite_open(part1, atoi(part2), NULL)</code></dd> + <dt>SQLite3</dt> + <dd>The connection string is passed straight through to <code>sqlite3_open</code></dd> + <dt>ODBC</dt> + <dd>datasource, user, password, connect, ctimeout, stimeout, access, txmode, bufsize</dd> + </dl> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="DBDPersist" id="DBDPersist">DBDPersist</a> <a name="dbdpersist" id="dbdpersist">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Whether to use persistent connections</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDPersist On|Off</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>If set to Off, persistent and pooled connections are disabled. + A new database connection is opened when requested by a client, + and closed immediately on release. This option is for debugging + and low-usage servers.</p> + + <p>The default is to enable a pool of persistent connections + (or a single LAMP-style persistent connection in the case of a + non-threaded server), and should almost always be used in operation.</p> + + <p>Prior to version 2.2.2, this directive accepted only the values + <code>0</code> and <code>1</code> instead of <code>Off</code> and + <code>On</code>, respectively.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="DBDPrepareSQL" id="DBDPrepareSQL">DBDPrepareSQL</a> <a name="dbdpreparesql" id="dbdpreparesql">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define an SQL prepared statement</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDPrepareSQL <var>"SQL statement"</var> <var>label</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>For modules such as authentication that repeatedly use a + single SQL statement, optimum performance is achieved by preparing + the statement at startup rather than every time it is used. + This directive prepares an SQL statement and assigns it a label.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="DBDriver" id="DBDriver">DBDriver</a> <a name="dbdriver" id="dbdriver">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify an SQL driver</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDriver <var>name</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Selects an apr_dbd driver by name. The driver must be installed + on your system (on most systems, it will be a shared object or dll). + For example, <code>DBDriver mysql</code> will select the MySQL + driver in apr_dbd_mysql.so.</p> + +</div> +</div> +<div class="bottomlang"> +<p><span>Available Languages: </span><a href="../en/mod/mod_dbd.html" title="English"> en </a> | +<a href="../fr/mod/mod_dbd.html" hreflang="fr" rel="alternate" title="Français"> fr </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_dbd.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/mod/mod_dbd.html.fr.utf8 b/docs/manual/mod/mod_dbd.html.fr.utf8 new file mode 100644 index 0000000..afd87a8 --- /dev/null +++ b/docs/manual/mod/mod_dbd.html.fr.utf8 @@ -0,0 +1,421 @@ +<?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 content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>mod_dbd - Serveur HTTP Apache Version 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body> +<div id="page-header"> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossaire</a> | <a href="../sitemap.html">Plan du site</a></p> +<p class="apache">Serveur HTTP Apache Version 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">Serveur HTTP</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">Modules</a></div> +<div id="page-content"> +<div id="preamble"><h1>Module Apache mod_dbd</h1> +<div class="toplang"> +<p><span>Langues Disponibles: </span><a href="../en/mod/mod_dbd.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../fr/mod/mod_dbd.html" title="Français"> fr </a></p> +</div> +<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Gestion des connexions Ă une base de donnĂ©es SQL</td></tr> +<tr><th><a href="module-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="module-dict.html#ModuleIdentifier">Identificateur de Module:</a></th><td>dbd_module</td></tr> +<tr><th><a href="module-dict.html#SourceFile">Fichier Source:</a></th><td>mod_dbd.c</td></tr> +<tr><th><a href="module-dict.html#Compatibility">CompatibilitĂ©:</a></th><td>Versions 2.1 and supĂ©rieures</td></tr></table> +<h3>Sommaire</h3> + + <p>Le module <code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> gĂšre les connexions + Ă une base de donnĂ©es SQL via <a class="glossarylink" href="../glossary.html#apr" title="voir glossaire">APR</a>. Il permet + aux modules qui requiĂšrent des fonctions liĂ©es aux bases de donnĂ©es + SQL de se connecter Ă une base de donnĂ©es Ă la demande, et s'efforce + de confĂ©rer aux bases de donnĂ©es une efficacitĂ© et une + Ă©volutivitĂ© optimales pour les MPMs threadĂ©s ou non threadĂ©s. Pour + plus de dĂ©tails, voir le site web <a href="http://apr.apache.org/">APR</a>, + ainsi que cette vue d'ensemble de l'<a href="http://people.apache.org/~niq/dbd.html">environnement de + dĂ©veloppement d'Apache DBD</a> par son dĂ©veloppeur initial. +</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3>Sujets</h3> +<ul id="topics"> +<li><img alt="" src="../images/down.gif" /> <a href="#pooling">Regroupement des connexions</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#connecting">Connexion</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#API">API DBD d'Apache</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#prepared">RequĂȘtes SQL prĂ©parĂ©es</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#security">AVERTISSEMENT DE SECURITE</a></li> +</ul><h3 class="directives">Directives</h3> +<ul id="toc"> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdexptime">DBDExptime</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdinitsql">DBDInitSQL</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdkeep">DBDKeep</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdmax">DBDMax</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdmin">DBDMin</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdparams">DBDParams</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdpersist">DBDPersist</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdpreparesql">DBDPrepareSQL</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#dbdriver">DBDriver</a></li> +</ul> +<h3>Traitement des bugs</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">Journal des modifications de httpd</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&list_id=144532&product=Apache%20httpd-2&query_format=specific&order=changeddate%20DESC%2Cpriority%2Cbug_severity&component=mod_dbd">ProblĂšmes connus</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&component=mod_dbd">Signaler un bug</a></li></ul><h3>Voir aussi</h3> +<ul class="seealso"> +<li><a href="../misc/password_encryptions.html">Formats des mots de +passe</a></li> +<li><a href="#comments_section">Commentaires</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="pooling" id="pooling">Regroupement des connexions</a></h2> + <p>Ce module gĂšre de maniĂšre optimisĂ©e en fonction de la plate-forme + les connexions aux bases de donnĂ©es. Sur les plates-formes non + threadĂ©es, il maintient une connexion persistente Ă la maniĂšre d'un + LAMP classique (Linux, Apache, Mysql, Perl/PHP/Python). Sur les + plates-formes threadĂ©es, il maintient un <em>groupe de + connexions</em> Ă la fois plus Ă©volutif et plus efficace, comme + dĂ©crit dans <a href="http://www.apachetutor.org/dev/reslist">cet + article d'ApacheTutor</a>. Notez que <code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> + remplace les modules prĂ©sentĂ©s dans cet article.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="connecting" id="connecting">Connexion</a></h2> + + <p>Pour vous connecter Ă votre base de donnĂ©es, vous devez spĂ©cifier un + pilote et des paramĂštres de connexion qui diffĂšrent selon le moteur de base + de donnĂ©es. Par exemple, pour vous connecter Ă mysql, spĂ©cifiez ce qui suit + :</p> + +<pre class="prettyprint lang-config">DBDriver mysql +DBDParams host=localhost,dbname=pony,user=shetland,pass=appaloosa</pre> + + + <p>Vous pourrez alors utiliser cette connexion dans de nombreux autres + modules comme <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>, <code class="module"><a href="../mod/mod_authn_dbd.html">mod_authn_dbd</a></code> + et <code class="module"><a href="../mod/mod_lua.html">mod_lua</a></code>. Vous trouverez des exemples d'utilisation dans + la documentation de ces modules.</p> + + <p>Voir la syntaxe de la directive <code class="directive">DBDParams</code> pour les + informations Ă fournir dans la chaĂźne de connexion en fonction des + diffĂ©rents pilotes de base de donnĂ©es supportĂ©s.</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="API" id="API">API DBD d'Apache</a></h2> + <p><code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> exporte cinq fonctions que d'autres + modules pourront utiliser. L'API se prĂ©sente comme suit :</p> + + <pre class="prettyprint lang-c">typedef struct { + apr_dbd_t *handle; + apr_dbd_driver_t *driver; + apr_hash_t *prepared; +} ap_dbd_t; + +/* Fonctions exportĂ©es pour accĂ©der Ă la base de donnĂ©es */ + +/* ouvre une connexion qui DOIT avoir Ă©tĂ© explicitement fermĂ©e. + * Renvoie NULL en cas d'erreur + */ +AP_DECLARE(ap_dbd_t*) ap_dbd_open(apr_pool_t*, server_rec*); + +/* ferme une connexion ouverte avec ap_dbd_open */ +AP_DECLARE(void) ap_dbd_close(server_rec*, ap_dbd_t*); + +/* acquiert une connexion qui aura la durĂ©e de vie de la requĂȘte et qui + * NE DOIT PAS avoir Ă©tĂ© explicitement fermĂ©e. Renvoie NULL en cas + * d'erreur. C'est la fonction recommandĂ©e pour la plupart des + * applications. + */ +AP_DECLARE(ap_dbd_t*) ap_dbd_acquire(request_rec*); + +/* acquiert une connexion qui aura la durĂ©e de vie d'une connexion et + * qui NE DOIT PAS avoir Ă©tĂ© explicitement fermĂ©e. Renvoie NULL en cas + * d'erreur. + */ +AP_DECLARE(ap_dbd_t*) ap_dbd_cacquire(conn_rec*); + +/* PrĂ©pare une requĂȘte qu'un module client pourra utiliser */ +AP_DECLARE(void) ap_dbd_prepare(server_rec*, const char*, const char*); + +/* Exporte aussi ces fonctions Ă titre optionnel mour les modules qui + * pĂ©fĂšreraient les utiliser */ +APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_open, (apr_pool_t*, server_rec*)); +APR_DECLARE_OPTIONAL_FN(void, ap_dbd_close, (server_rec*, ap_dbd_t*)); +APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_acquire, (request_rec*)); +APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_cacquire, (conn_rec*)); +APR_DECLARE_OPTIONAL_FN(void, ap_dbd_prepare, (server_rec*, const char*, const char*));</pre> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="prepared" id="prepared">RequĂȘtes SQL prĂ©parĂ©es</a></h2> + <p><code class="module"><a href="../mod/mod_dbd.html">mod_dbd</a></code> supporte les requĂȘtes SQL prĂ©parĂ©es Ă + destination des modules qui pourraient les utiliser. Chaque requĂȘte + prĂ©parĂ©e doit possĂ©der un nom (Ă©tiquette), et est stockĂ©e dans un + condensĂ© (hash) : les condensĂ©s sont du type + <code>apr_dbd_prepared_t</code> et s'utilisent dans toute requĂȘte + SQL ou commande select prĂ©parĂ©e par apr_dbd.</p> + + <p>Il est du ressort des modules utilisateurs de dbd d'utiliser les + requĂȘtes prĂ©parĂ©es et de prĂ©ciser quelles requĂȘtes doivent ĂȘtre + spĂ©cifiĂ©es dans httpd.conf, ou de fournir leurs propres directives + et d'utiliser <code>ap_dbd_prepare</code>.</p> + + <div class="warning"><h3>Avertissement</h3> + Lorsqu'on utilise des requĂȘtes prĂ©parĂ©es avec des bases de + donnĂ©es MySQL, il est prĂ©fĂ©rable de dĂ©finir + <code>reconnect</code> Ă 0 dans la chaĂźne de connexion, afin + d'Ă©viter des erreurs provoquĂ©es par un client MySQL qui se + reconnecterait sans rĂ©initialiser correctement les requĂȘtes + prĂ©parĂ©es. Si <code>reconnect</code> est dĂ©fini Ă 1, toute + connexion dĂ©fectueuse sera sensĂ©e ĂȘtre rĂ©parĂ©e, mais comme + mod_dbd n'en est pas informĂ©, les requĂȘtes prĂ©parĂ©es seront + invalidĂ©es. + </div> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="security" id="security">AVERTISSEMENT DE SECURITE</a></h2> + + <p>Toute application web impliquant une base de donnĂ©es doit se + protĂ©ger elle-mĂȘme contre les attaques de type injection SQL. Dans + la plupart des cas Apache DBD est sĂ»r, car les applications + utilisent des requĂȘtes prĂ©parĂ©es, et les entrĂ©es non sures ne seront + utilisĂ©es qu'Ă titre de donnĂ©es. Bien entendu, si vous l'utilisez + via un module tiers, vous devez ĂȘtre au fait des prĂ©cautions Ă + prendre.</p> + <p>Cependant, le pilote <var>FreeTDS</var> est <strong>non + sĂ»r</strong> de par sa nature-mĂȘme. Comme la bibliothĂšque + sous-jacente ne supporte pas les requĂȘtes prĂ©parĂ©es, le pilote en + effectue une Ă©mulation, et les entrĂ©es non sĂ»res sont fusionnĂ©es + avec la requĂȘte SQL.</p> + <p>Il peut ĂȘtre sĂ©curisĂ© en <em>dĂ©contaminant</em> toutes les + entrĂ©es : un processus inspirĂ© de la recherche de contaminations + (<strong>taint mode</strong>) de + Perl. Chaque entrĂ©e est comparĂ©e Ă une expression rationnelle, et + seules les entrĂ©es qui correspondent sont utilisĂ©es, en accord avec + le langage Perl :</p> + <div class="example"><pre><code> $untrusted =~ /([a-z]+)/; + $trusted = $1;</code></pre></div> + <p>Pour utiliser ceci, les expressions rationnelles de + dĂ©contamination doivent ĂȘtre incluses dans les requĂȘtes prĂ©parĂ©es. + L'expression rationnelle doit se situer immĂ©diatement aprĂšs le + caractĂšre % dans la requĂȘte prĂ©parĂ©e, et doit ĂȘtre entourĂ©e + d'accolades {}. Par exemple, si votre application attend une entrĂ©e + alphanumĂ©rique, vous pouvez utiliser :</p> + <div class="example"><p><code> + <code>"SELECT foo FROM bar WHERE input = %s"</code> + </code></p></div> + <p>avec d'autres pilotes, et ne risquer au pire qu'une requĂȘte + Ă©chouĂ©e. Mais avec FreeTDS, vous devez utiliser :</p> + <div class="example"><p><code> + <code>"SELECT foo FROM bar WHERE input = %{([A-Za-z0-9]+)}s"</code> + </code></p></div> + <p>tout ce qui ne correspond pas Ă l'expression rationnelle est + alors rejetĂ©, et la requĂȘte est maintenant sĂ»re.</p> + <p>Alternativement, vous pouvez utiliser le pilote ODBC tiers, qui + offre la sĂ©curitĂ© des requĂȘtes prĂ©parĂ©es authentiques.</p> +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="dbdexptime" id="dbdexptime">Directive</a> <a name="DBDExptime" id="DBDExptime">DBDExptime</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>DurĂ©e de vie des connexions inactives</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DBDExptime <var>durĂ©e en secondes</var></code></td></tr> +<tr><th><a href="directive-dict.html#Default">DĂ©faut:</a></th><td><code>DBDExptime 300</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Cette directive permet de dĂ©finir la durĂ©e de vie des connexions + inactives lorsque le nombre de connexions spĂ©cifiĂ© par la directive + DBDKeep a Ă©tĂ© dĂ©passĂ© (plates-formes threadĂ©es uniquement).</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="dbdinitsql" id="dbdinitsql">Directive</a> <a name="DBDInitSQL" id="DBDInitSQL">DBDInitSQL</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>ExĂ©cute une instruction SQL aprĂšs connexion Ă une base de +donnĂ©es</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DBDInitSQL <var>"instruction SQL"</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Les modules qui le souhaitent peuvent exĂ©cuter une ou plusieurs + instructions SQL aprĂšs connexion Ă une base de donnĂ©es. Par exemple + initialiser certaines valeurs, ou ajouter une entrĂ©e dans le journal + lors d'une nouvelle connexion Ă la base de donnĂ©es.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="dbdkeep" id="dbdkeep">Directive</a> <a name="DBDKeep" id="DBDKeep">DBDKeep</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Nombre maximum de connexions maintenues</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DBDKeep <var>nombre</var></code></td></tr> +<tr><th><a href="directive-dict.html#Default">DĂ©faut:</a></th><td><code>DBDKeep 2</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Cette directive permet de dĂ©finir le nombre maximum de connexions + Ă maintenir par processus, en dehors de celles servant Ă gĂ©rer les + pics de demandes (plates-formes threadĂ©es uniquement).</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="dbdmax" id="dbdmax">Directive</a> <a name="DBDMax" id="DBDMax">DBDMax</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Nombre maximum de connexions</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DBDMax <var>nombre</var></code></td></tr> +<tr><th><a href="directive-dict.html#Default">DĂ©faut:</a></th><td><code>DBDMax 10</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Cette directive permet de dĂ©finir le nombre maximum effectif de + connexions par processus (plates-formes threadĂ©es uniquement).</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="dbdmin" id="dbdmin">Directive</a> <a name="DBDMin" id="DBDMin">DBDMin</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Nombre minimum de connexions</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DBDMin <var>nombre</var></code></td></tr> +<tr><th><a href="directive-dict.html#Default">DĂ©faut:</a></th><td><code>DBDMin 1</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Cette directive permet de dĂ©finir le nombre minimum de connexions + par processus (plates-formes threadĂ©es uniquement).</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="dbdparams" id="dbdparams">Directive</a> <a name="DBDParams" id="DBDParams">DBDParams</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>ParamĂštres de la connexion Ă la base de +donnĂ©es</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DBDParams +<var>param1</var>=<var>valeur1</var>[,<var>param2</var>=<var>valeur2</var>]</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Cette directive permet de spĂ©cifier des paramĂštres selon les + besoins du pilote concernĂ©. En gĂ©nĂ©ral, les paramĂštres Ă passer + concernent tout ce qui n'a pas de valeur par dĂ©faut comme le nom + d'utilisateur, le mot de passe, le nom de la base de donnĂ©es, le nom + d'hĂŽte et le numĂ©ro de port de la connexion.</p> + <p>Les paramĂštres de la chaĂźne de connexion en fonction des + diffĂ©rents pilotes comprennent :</p> + <dl> + <dt>FreeTDS (pour MSSQL et SyBase)</dt> + <dd>username, password, appname, dbname, host, charset, lang, server</dd> + <dt>MySQL</dt> + <dd>host, port, user, pass, dbname, sock, flags, fldsz, group, reconnect</dd> + <dt>Oracle</dt> + <dd>user, pass, dbname, server</dd> + <dt>PostgreSQL</dt> + <dd>La chaĂźne de connexion est passĂ©e directement Ă <code>PQconnectdb</code></dd> + <dt>SQLite2</dt> + <dd>La chaĂźne de connexion est scindĂ©e avec comme sĂ©parateur le + caractĂšre ':', et <code>partie1:partie2</code> est utilisĂ© dans + <code>sqlite_open(partie1, atoi(partie2), NULL)</code></dd> + <dt>SQLite3</dt> + <dd>La chaĂźne de connexion est passĂ©e directement Ă <code>sqlite3_open</code></dd> + <dt>ODBC</dt> + <dd>datasource, user, password, connect, ctimeout, stimeout, access, txmode, bufsize</dd> + </dl> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="dbdpersist" id="dbdpersist">Directive</a> <a name="DBDPersist" id="DBDPersist">DBDPersist</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Utiliser ou non des connexions persistentes</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DBDPersist On|Off</code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Si cette directive est dĂ©finie Ă Off, les connexions persistentes + et les connexions groupĂ©es sont dĂ©sactivĂ©es. Ă la demande d'un + client, une nouvelle connexion Ă la base de donnĂ©es est ouverte, et + fermĂ©e immĂ©diatement Ă l'issue du traitement. Cette configuration ne + doit ĂȘtre utilisĂ©e qu'Ă des fins de dĂ©bogage, ou sur des serveurs Ă + charge faible.</p> + + <p>Par dĂ©faut, les groupes de connexions persistentes sont activĂ©s + (ou une seule connexion persistente du style LAMP pour les serveurs + non threadĂ©s), et c'est la configuration qui devrait ĂȘtre utilisĂ©e + dans la plupart des cas sur un serveur en production.</p> + + <p>Avant la version 2.2.2, cette directive n'acceptait que les + valeurs <code>0</code> et <code>1</code> au lieu de <code>Off</code> + et <code>On</code>, respectivement.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="dbdpreparesql" id="dbdpreparesql">Directive</a> <a name="DBDPrepareSQL" id="DBDPrepareSQL">DBDPrepareSQL</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>DĂ©finit une requĂȘte SQL prĂ©parĂ©e</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DBDPrepareSQL <var>"requĂȘte SQL"</var> <var>Ă©tiquette</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Pour les modules tels que les modules d'authentification, qui + utilisent de maniĂšre rĂ©pĂ©tĂ©e la mĂȘme requĂȘte SQL, on peut optimiser + les performances en prĂ©parant la requĂȘte une fois pour toutes au + dĂ©marrage, plutĂŽt qu'Ă chaque utilisation. Cette directive permet de + prĂ©parer une requĂȘte SQL et de lui assigner une Ă©tiquette.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="dbdriver" id="dbdriver">Directive</a> <a name="DBDriver" id="DBDriver">DBDriver</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>SpĂ©cifie un pilote SQL</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DBDriver <var>nom</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr> +</table> + <p>Cette directive permet de spĂ©cifier un pilote apr_dbd par son + nom. Le pilote doit ĂȘtre installĂ© sur votre systĂšme (sur la plupart + des systĂšmes, il s'agit d'un objet partagĂ© ou d'une dll). Par + exemple, <code>DBDriver mysql</code> va sĂ©lectionner le pilote MySQL + dans la bibliothĂšque apr_dbd_mysql.so.</p> + +</div> +</div> +<div class="bottomlang"> +<p><span>Langues Disponibles: </span><a href="../en/mod/mod_dbd.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../fr/mod/mod_dbd.html" title="Français"> fr </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Commentaires</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_dbd.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />AutorisĂ© sous <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossaire</a> | <a href="../sitemap.html">Plan du site</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file |