There must be no other characters or white space between the
backslash and the end of the line.</p>
+ <p>Arguments to directives are separated by whitespace. If an
+ argument contains spaces, you must enclose that argument in quotes.</p>
+
<p>Directives in the configuration files are case-insensitive,
but arguments to directives are often case sensitive. Lines
that begin with the hash character "#" are considered
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="./style/manual.de.xsl"?>
-<!-- English Revision: 420990:1343935 (outdated) -->
+<!-- English Revision: 420990:1470510 (outdated) -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
<?xml-stylesheet type="text/xsl" href="./style/manual.fr.xsl"?>
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
-<!-- English Revision: 1243935:1343935 (outdated) -->
+<!-- English Revision: 1243935:1470510 (outdated) -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="./style/manual.ja.xsl"?>
-<!-- English Revision: 420990:1343935 (outdated) -->
+<!-- English Revision: 420990:1470510 (outdated) -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
<?xml version='1.0' encoding='EUC-KR' ?>
<!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="./style/manual.ko.xsl"?>
-<!-- English Revision: 420990:1343935 (outdated) -->
+<!-- English Revision: 420990:1470510 (outdated) -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="./style/manual.tr.xsl"?>
-<!-- English Revision: 1213338:1343935 (outdated) -->
+<!-- English Revision: 1213338:1470510 (outdated) -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
<a href="../ja/mod/mod_auth_basic.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
<a href="../ko/mod/mod_auth_basic.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
</div>
-<div class="outofdate">Cette traduction peut être périmée. Vérifiez la version
- anglaise pour les changements récents.</div>
<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Authentification HTTP de base</td></tr>
<tr><th><a href="module-dict.html#Status">Statut:</a></th><td>Base</td></tr>
<tr><th><a href="module-dict.html#ModuleIdentifier">Identificateur de Module:</a></th><td>auth_basic_module</td></tr>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Authentification de base simulée à l'aide des nom
d'utilisateur et mot de passe fournis</td></tr>
-<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>AuthBasicFake username password</code></td></tr>
+<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>AuthBasicFake off|nom-utilisateur [mot-de-passe]</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Défaut:</a></th><td><code>none</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>répertoire, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">AllowOverride:</a></th><td>AuthConfig</td></tr>
d'expression</a>, ce qui permet de les définir en fonction de
paramètres de la requête.</p>
+ <p>Si aucun mot de passe n'est spécifié, la valeur par défaut
+ "password" sera utilisée. Pour désactiver l'authentification de base
+ simulée pour un espace d'URL, définissez AuthBasicFake à "off".</p>
+
<p>Dans l'exemple suivant, un nom d'utilisateur et un mot de passe
prédéfinis sont transmis à un serveur d'arrière-plan :</p>
<div class="example"><h3>Exemple d'utilisation avec un certificat</h3><pre class="prettyprint lang-config">
<Location /secure>
- AuthBasicFake %{SSL_CLIENT_S_DN_Email} password
+ AuthBasicFake %{SSL_CLIENT_S_DN_Email}
</Location>
</pre>
</div>
</pre>
</div>
+ <div class="example"><h3>Désactivation de l'authentification simulée</h3><pre class="prettyprint lang-config">
+<Location /public>
+ AuthBasicFake off
+</Location>
+ </pre>
+</div>
+
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<variants>
<variant>en</variant>
- <variant outdated="yes">fr</variant>
+ <variant>fr</variant>
<variant outdated="yes">ja</variant>
<variant outdated="yes">ko</variant>
</variants>
<p>Hook functions are how modules (and Lua scripts) participate in the
processing of requests. Each type of hook exposed by the server exists for
-a specific purpose, such as mapping requests to the filesystem,
-performing access control, or setting mimetypes:</p>
+a specific purpose, such as mapping requests to the file system,
+performing access control, or setting mime types:</p>
<table class="bordered"><tr class="header">
<th>Hook phase</th>
(except for LuaAuthzProvider, which also gets passed the arguments from
the Require directive).
They can return any value, depending on the hook, but most commonly
-they'll return OK, DONE, or DECLINED, which you can write in lua as
+they'll return OK, DONE, or DECLINED, which you can write in Lua as
<code>apache2.OK</code>, <code>apache2.DONE</code>, or
<code>apache2.DECLINED</code>, or else an HTTP status code.</p>
<dd>
<p>The request_rec is mapped in as a userdata. It has a metatable
which lets you do useful things with it. For the most part it
- has the same fields as the request_rec struct, many of which are writeable as
+ has the same fields as the request_rec struct, many of which are writable as
well as readable. (The table fields' content can be changed, but the
fields themselves cannot be set to different tables.)</p>
<p>The request_rec object has (at least) the following methods:</p>
<pre class="prettyprint lang-lua">
-r:flush() -- flushes the output buffer:
+r:flush() -- flushes the output buffer.
+ -- Returns true if the flush was successful, false otherwise.
while we_have_stuff_to_send do
r:puts("Bla bla bla\n") -- print something to client
<pre class="prettyprint lang-lua">
-r:os_escape_path(file_path) -- Converts an OS path to a URL in an OS dependant way
+r:os_escape_path(file_path) -- Converts an OS path to a URL in an OS dependent way
</pre>
r:ivm_set("key", value) -- Set an Inter-VM variable to hold a specific value.
-- These values persist even though the VM is gone or not being used,
-- and so should only be used if MaxConnectionsPerChild is > 0
- -- Values can be numbers, strings and booleans.
+ -- Values can be numbers, strings and booleans, and are stored on a
+ -- per process basis (so they won't do much good with a prefork mpm)
r:ivm_get("key") -- Fetches a variable set by ivm_set. Returns the contents of the variable
-- if it exists or nil if no such variable exists.
+
+-- An example getter/setter that saves a global variable outside the VM:
+function handle(r)
+ -- First VM to call this will get no value, and will have to create it
+ local foo = r:ivm_get("cached_data")
+ if not foo then
+ foo = do_some_calcs() -- fake some return value
+ r:ivm_set("cached_data", foo) -- set it globally
+ end
+ r:puts("Cached data is: ", foo)
+end
</pre>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_lua</td></tr>
</table>
- <p>Specify the lifecycle scope of the Lua interpreter which will
+ <p>Specify the life cycle scope of the Lua interpreter which will
be used by handlers in this "Directory." The default is "once"</p>
<dl>
provenance de la directive Require). Elles peuvent renvoyer une valeur,
selon la fonction, mais il s'agit en général d'un
code d'état HTTP ou des valeurs OK, DONE, ou DECLINED,
-que vous pouvez écrire dans lua sous la forme <code>apache2.OK</code>,
+que vous pouvez écrire dans Lua sous la forme <code>apache2.OK</code>,
<code>apache2.DONE</code>, ou <code>apache2.DECLINED</code>.</p>
<p>L'objet request_rec possède (au minimum) les méthodes suivantes :</p>
<pre class="prettyprint lang-lua">
-r:flush() -- vide le tampon de sortie
+r:flush() -- vide le tampon de sortie
+ -- Renvoie true si le vidage a été effectué avec succès,
+ false dans le cas contraire.
while nous_avons_des_données_à_envoyer do
r:puts("Bla bla bla\n") -- envoi des données à envoyer vers le tampon
</pre>
-<pre class="prettyprint lang-lua">
-r:started() -- Renvoie l'heure du dernier (re)démarrage du
-serveur.
-</pre>
-
-
<pre class="prettyprint lang-lua">
r:clock() -- Renvoie l'heure courante avec une précision d'une
microseconde.
<pre class="prettyprint lang-lua">
-r:strcmp_match(string, pattern) -- Vérifie si 'string' correspond à
+r.strcmp_match(string, pattern) -- Vérifie si 'string' correspond à
'pattern' via la fonction strcmp_match (GLOBs). Par exemple, est-ce que
'www.example.com' correspond à '*.example.com' ?
-local match = r:strcmp_match("foobar.com", "foo*.com")
+local match = r.strcmp_match("foobar.com", "foo*.com")
if match then
r:puts("foobar.com matches foo*.com")
end
<pre class="prettyprint lang-lua">
-r:exists_config_define(string) -- Vérifie si une définition de
+r.exists_config_define(string) -- Vérifie si une définition de
configuration existe.
-if r:exists_config_define("FOO") then
+if r.exists_config_define("FOO") then
r:puts("httpd a probablement été lancé avec l'option -DFOO, ou FOO a
été défini dans la configuration")
end
<pre class="prettyprint lang-lua">
-r:regex(string, pattern) -- Exécute une recherche à base
+r:regex(string, pattern, [drapeaux]) -- Exécute une recherche à base
d'expression rationnelle sur une chaîne, et renvoie les
éventuelles correspondances trouvées.
-local matches = r:regex("foo bar baz", "foo (\w+) (\S*)")
+local matches = r:regex("foo bar baz", [[foo (\w+) (\S*)]])
if matches then
r:puts("L'expression rationnelle correspond et le dernier mot
capturé ($2) est : " .. matches[2])
end
+
+-- Exemple avec insensibilité à la casse :
+local matches = r:regex("FOO bar BAz", [[(foo) bar]], 1)
+
+-- les drapeaux peuvent être une combibaison bit à bit de :
+-- 0x01: insensibilité à la casse
+-- 0x02: recherche multiligne
</pre>
détails.
</pre>
-
+
+<pre class="prettyprint lang-lua">
+r:ivm_set("key", value) -- Défini une variable Inter-VM avec une valeur spécifique.
+ -- Ces valeurs sont conservées même si la VM est
+ -- arrêtée ou non utilisée, et ne doivent donc être
+ -- utilisées que si MaxConnectionsPerChild > 0.
+ -- Les valeurs peuvent être de type number, string
+ -- ou boolean.
+
+r:ivm_get("key") -- Lit le contenu d'une variable définie via ivm_set. Renvoie
+ -- le contenu de la variable si elle existe, ou nil
+ -- dans le cas contraire.
+</pre>
+
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision : 1470158 -->
+<!-- English Revision: 1470158:1470271 (outdated) -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<p><span>Langues Disponibles: </span><a href="../en/mod/mod_rewrite.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../fr/mod/mod_rewrite.html" title="Français"> fr </a></p>
</div>
-<div class="outofdate">Cette traduction peut être périmée. Vérifiez la version
- anglaise pour les changements récents.</div>
<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Ce module fournit un moteur de réécriture à base de
règles permettant de réécrire les URLs des requêtes
à la volée</td></tr>
</li>
<li>A des fins de référence avant, on peut utiliser,
- <code>%{LA-U:variable}</code>, qui
+ <a id="LA-U" name="LA-U"><code>%{LA-U:variable}</code></a>, qui
permet d'effectuer une sous-requête interne à base d'URL, afin
de déterminer la valeur finale de <em>variable</em>. Ceci permet
d'accéder à la valeur d'une variable pour la réécriture inconnue
<variants>
<variant>en</variant>
- <variant outdated="yes">fr</variant>
+ <variant>fr</variant>
</variants>
</metafile>