<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
-<modulesynopsis>
+<!-- $LastChangedRevision$ -->
+
+<!--
+ Copyright 2002-2006 The Apache Software Foundation or its licensors, as
+ applicable.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<modulesynopsis metafile="mod_setenvif.xml.meta">
<name>mod_setenvif</name>
<description>Allows the setting of environment variables based
<usage>
<p>The <directive>SetEnvIf</directive> directive defines
environment variables based on attributes of the request. The
- <em>attribute</em> specified in the first argument can be one of three
+ <em>attribute</em> specified in the first argument can be one of four
things:</p>
<ol>
<li><code>Remote_Addr</code> - the IP address of the client
making the request</li>
- <li><code>Remote_User</code> - the authenticated username (if
- available)</li>
+ <li><code>Server_Addr</code> - the IP address of the server
+ on which the request was received (only with versions later
+ than 2.0.43)</li>
<li><code>Request_Method</code> - the name of the method
being used (<code>GET</code>, <code>POST</code>, <em>et
Environment variables will be considered only if there was no match
among request characteristics and a regular expression was not
used for the <em>attribute</em>.</li>
+
+<li>
+ A reference to an extension of an SSL client certificate, located by
+ its object id <em>oid</em>.
+ If a non-SSL request, or in absense of the configured <em>oid</em>,
+ no variable will be set. If the <em>oid</em> is found multiple times,
+ the individual strings will be concatenated, separated by a comma <code>','</code>.
+ The <em>oid</em> should reference a string-valued extension.
+</li>
</ol>
-<p>The second argument (<em>regex</em>) is a <a
-href="http://www.pcre.org/">Perl compatible regular expression</a>.
-This is similar to a POSIX.2 egrep-style regular expression.
-If the <em>regex</em> matches against the <em>attribute</em>,
-then the remainder of the arguments are evaluated.</p>
+<p>The second argument (<em>regex</em>) is a <glossary
+ref="regex">regular expression</glossary>. If the <em>regex</em>
+matches against the <em>attribute</em>, then the remainder of the
+arguments are evaluated.</p>
<p>The rest of the arguments give the names of variables to set, and
optionally values to which they should be set. These take the form
<p>In the first form, the value will be set to "1". The second
will remove the given variable if already defined, and the
third will set the variable to the literal value given by
- <code><em>value</em></code>.</p>
+ <code><em>value</em></code>. Since version 2.0.51 Apache will
+ recognize occurrences of <code>$1</code>..<code>$9</code> within
+ <var>value</var> and replace them by parenthesized subexpressions
+ of <var>regex</var>.</p>
<example>
<title>Example:</title>
:<br />
SetEnvIf object_is_image xbm XBIT_PROCESSING=1<br />
:<br />
+ SetEnvIf OID("2.16.840.1.113730.1.13") "(.*)" NetscapeComment=$1<br />
+ :<br />
SetEnvIf ^TS* ^[a-z].* HAVE_TS<br />
</example>
the referring page was somewhere on the
<code>www.mydomain.com</code> Web site.</p>
+ <p>The sixth example will set the <code>NetscapeComment</code>
+ environment variable to the string found in the corresponding
+ SSL client certificate field (if found).</p>
+
<p>The last example will set environment variable
<code>HAVE_TS</code> if the request contains any headers that
begin with "TS" whose values begins with any character in the
set [a-z].</p>
</usage>
+
+<seealso><a href="../env.html">Environment Variables in Apache</a>,
+for additional examples.
+</seealso>
</directivesynopsis>
<directivesynopsis>
combination.</p>
</usage>
</directivesynopsis>
-</modulesynopsis>
\ No newline at end of file
+</modulesynopsis>