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<!--
031b91a62d25106ae69d4693475c79618dd5e884fielding Licensed to the Apache Software Foundation (ASF) under one or more
031b91a62d25106ae69d4693475c79618dd5e884fielding contributor license agreements. See the NOTICE file distributed with
031b91a62d25106ae69d4693475c79618dd5e884fielding this work for additional information regarding copyright ownership.
031b91a62d25106ae69d4693475c79618dd5e884fielding The ASF licenses this file to You under the Apache License, Version 2.0
031b91a62d25106ae69d4693475c79618dd5e884fielding (the "License"); you may not use this file except in compliance with
031b91a62d25106ae69d4693475c79618dd5e884fielding the License. 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
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>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh <highlight language="config">
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;IfVersion 2.4.2&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # current httpd version is exactly 2.4.2
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;/IfVersion&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;IfVersion >= 2.5&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # use really new features :-)
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;/IfVersion&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh </highlight>
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
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd configuration directives which are executed only if the
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd <program>httpd</program> 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>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh <highlight language="config">
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;IfVersion >= 2.3&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # this happens only in versions greater or
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # equal 2.3.0.
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;/IfVersion&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh </highlight>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd </example>
7ccd2526c2d2128d7b6c4ed090e3982d7da8c651nd
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p>Besides the numerical comparison it is possible to match a
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <glossary ref="regex">regular expression</glossary>
030108b1816bcda3d925df65357feabdce83bc94slive 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>
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh <highlight language="config">
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;IfVersion = /^2.4.[01234]$/&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # e.g. workaround for buggy versions
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;/IfVersion&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh </highlight>
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
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh <highlight language="config">
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;IfVersion !~ ^2.4.[01234]$&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh # not for those versions
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh&lt;/IfVersion&gt;
6fcd2523fee8fb3aca9541dc7149de6048110a39humbedooh </highlight>
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>