mod_version.xml revision 5f5d1b4cc970b7f06ff8ef6526128e9a27303d88
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<?xml version="1.0"?>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<!--
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd Copyright 2004 The Apache Software Foundation
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd Licensed under the Apache License, Version 2.0 (the "License");
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd you may not use this file except in compliance with the License.
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd You may obtain a copy of the License at
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd http://www.apache.org/licenses/LICENSE-2.0
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd Unless required by applicable law or agreed to in writing, software
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd distributed under the License is distributed on an "AS IS" BASIS,
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd See the License for the specific language governing permissions and
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd limitations under the License.
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd-->
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<modulesynopsis metafile="mod_version.xml.meta">
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<name>mod_version</name>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<description>Version dependent configuration</description>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<status>Extension</status>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<sourcefile>mod_version.c</sourcefile>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<identifier>version_module</identifier>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<compatibility>Available in version 2.1 and later</compatibility>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<summary>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>This module is designed for the use in test suites and large
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd networks which have to deal with different httpd versions and
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd different configurations. It provides a new container -- <directive
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd type="section" module="mod_version">IfVersion</directive>, which
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd allows a flexible version checking including numeric comparisons and
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd regular expressions.</p>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <example><title>Examples</title>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;IfVersion 2.1.0&gt;<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # current httpd version is exactly 2.1.0<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;/IfVersion&gt;<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;IfVersion >= 2.2&gt;<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # use really new features :-)<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;/IfVersion&gt;
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>See below for further possibilities.</p>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd</summary>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<directivesynopsis type="section">
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<name>IfVersion</name>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<description>contains version dependent configuration</description>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<syntax>&lt;IfVersion [[!]<var>operator</var>] <var>version</var>&gt; ...
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd&lt;/IfVersion&gt;</syntax>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<contextlist><context>server config</context><context>virtual host</context>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<context>directory</context><context>.htaccess</context></contextlist>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<override>All</override>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd<usage>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>The <directive type="section">IfVersion</directive> section encloses
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd configuration directives which are executed only if the httpd version
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd matches the desired criteria. For normal (numeric) comparisons the
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <var>version</var> argument has the format
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <code><var>major</var>[.<var>minor</var>[.<var>patch</var>]]</code>, e.g.
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <code>2.1.0</code> or <code>2.2</code>. <var>minor</var> and
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <var>patch</var> are optional. If these numbers are omitted, they are
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd assumed to be zero. The following numerical <var>operator</var>s are
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd possible:</p>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
1235345dc5fd04766bcf6f9c18d14638eda2eea1nd <table style="zebra" border="1">
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <tr><th><var>operator</var></th><th>description</th></tr>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <tr><td><code>=</code> or <code>==</code></td>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <td>httpd version is equal</td></tr>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <tr><td><code>&gt;</code></td>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <td>httpd version is greater than</td></tr>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <tr><td><code>&gt;=</code></td>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <td>httpd version is greater or equal</td></tr>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <tr><td><code>&lt;</code></td>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <td>httpd version is less than</td></tr>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <tr><td><code>&lt;=</code></td>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <td>httpd version is less or equal</td></tr>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </table>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <example><title>Example</title>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;IfVersion >= 2.1&gt;<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # this happens only in versions greater or<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # equal 2.1.0.<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;/IfVersion&gt;
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>Besides the numerical comparison it is possible to match a regular
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd expression against the httpd version. There are two ways to write it:</p>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
1235345dc5fd04766bcf6f9c18d14638eda2eea1nd <table style="zebra" border="1">
1235345dc5fd04766bcf6f9c18d14638eda2eea1nd <tr><th><var>operator</var></th><th>description</th></tr>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <tr><td><code>=</code> or <code>==</code></td>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <td><var>version</var> has the form
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <code>/<var>regex</var>/</code></td></tr>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <tr><td><code>~</code></td>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <td><var>version</var> has the form
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <code><var>regex</var></code></td></tr>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </table>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <example><title>Example</title>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;IfVersion = /^2.1.[01234]$/&gt;<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # e.g. workaround for buggy versions
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;/IfVersion&gt;
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <p>In order to reverse the meaning, all operators can be preceded by an
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd exclamation mark (<code>!</code>):</p>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;IfVersion !~ ^2.1.[01234]$&gt;<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd <indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd # not for those versions<br />
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </indent>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd &lt;/IfVersion&gt;
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
1235345dc5fd04766bcf6f9c18d14638eda2eea1nd <p>If the <var>operator</var> is omitted, it is assumed to be
1235345dc5fd04766bcf6f9c18d14638eda2eea1nd <code>=</code>.</p>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd</usage>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd</directivesynopsis>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd</modulesynopsis>