]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_version.html.en
rebuild
[apache] / docs / manual / mod / mod_version.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
4 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
5 <!--
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7               This file is generated from xml source: DO NOT EDIT
8         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9       -->
10 <title>mod_version - Apache HTTP Server Version 2.5</title>
11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <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" />
14 <script src="../style/scripts/prettify.min.js" type="text/javascript">
15 </script>
16
17 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
18 <body>
19 <div id="page-header">
20 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.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>
21 <p class="apache">Apache HTTP Server Version 2.5</p>
22 <img alt="" src="../images/feather.png" /></div>
23 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
24 <div id="path">
25 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Modules</a></div>
26 <div id="page-content">
27 <div id="preamble"><h1>Apache Module mod_version</h1>
28 <div class="toplang">
29 <p><span>Available Languages: </span><a href="../en/mod/mod_version.html" title="English">&nbsp;en&nbsp;</a> |
30 <a href="../fr/mod/mod_version.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
31 <a href="../ja/mod/mod_version.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
32 <a href="../ko/mod/mod_version.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
33 </div>
34 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Version dependent configuration</td></tr>
35 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
36 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>version_module</td></tr>
37 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_version.c</td></tr></table>
38 <h3>Summary</h3>
39
40     <p>This module is designed for the use in test suites and large
41     networks which have to deal with different httpd versions and
42     different configurations. It provides a new container -- <code class="directive"><a href="#ifversion">&lt;IfVersion&gt;</a></code>, which
43     allows a flexible version checking including numeric comparisons and
44     regular expressions.</p>
45
46     <div class="example"><h3>Examples</h3><pre class="prettyprint lang-config">&lt;IfVersion 2.4.2&gt;
47     # current httpd version is exactly 2.4.2
48 &lt;/IfVersion&gt;
49
50 &lt;IfVersion &gt;= 2.5&gt;
51     # use really new features :-)
52 &lt;/IfVersion&gt;</pre>
53 </div>
54
55     <p>See below for further possibilities.</p>
56 </div>
57 <div id="quickview"><h3 class="directives">Directives</h3>
58 <ul id="toc">
59 <li><img alt="" src="../images/down.gif" /> <a href="#ifversion">&lt;IfVersion&gt;</a></li>
60 </ul>
61 <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__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_version">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_version">Report a bug</a></li></ul><h3>See also</h3>
62 <ul class="seealso">
63 <li><a href="#comments_section">Comments</a></li></ul></div>
64
65 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
66 <div class="directive-section"><h2><a name="IfVersion" id="IfVersion">&lt;IfVersion&gt;</a> <a name="ifversion" id="ifversion">Directive</a></h2>
67 <table class="directive">
68 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>contains version dependent configuration</td></tr>
69 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;IfVersion [[!]<var>operator</var>] <var>version</var>&gt; ...
70 &lt;/IfVersion&gt;</code></td></tr>
71 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
72 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
73 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
74 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_version</td></tr>
75 </table>
76     <p>The <code class="directive">&lt;IfVersion&gt;</code> section encloses
77     configuration directives which are executed only if the
78     <code class="program"><a href="../programs/httpd.html">httpd</a></code> version
79     matches the desired criteria. For normal (numeric) comparisons the
80     <var>version</var> argument has the format
81     <code><var>major</var>[.<var>minor</var>[.<var>patch</var>]]</code>, e.g.
82     <code>2.1.0</code> or <code>2.2</code>. <var>minor</var> and
83     <var>patch</var> are optional. If these numbers are omitted, they are
84     assumed to be zero. The following numerical <var>operator</var>s are
85     possible:</p>
86
87     <table class="bordered"><tr class="header"><th><var>operator</var></th><th>description</th></tr>
88 <tr><td><code>=</code> or <code>==</code></td>
89         <td>httpd version is equal</td></tr>
90 <tr class="odd"><td><code>&gt;</code></td>
91         <td>httpd version is greater than</td></tr>
92 <tr><td><code>&gt;=</code></td>
93         <td>httpd version is greater or equal</td></tr>
94 <tr class="odd"><td><code>&lt;</code></td>
95         <td>httpd version is less than</td></tr>
96 <tr><td><code>&lt;=</code></td>
97         <td>httpd version is less or equal</td></tr>
98 </table>
99
100     <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">&lt;IfVersion &gt;= 2.3&gt;
101     # this happens only in versions greater or
102     # equal 2.3.0.
103 &lt;/IfVersion&gt;</pre>
104 </div>
105
106     <p>Besides the numerical comparison it is possible to match a
107     <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
108     against the httpd version. There are two ways to write it:</p>
109
110     <table class="bordered"><tr class="header"><th><var>operator</var></th><th>description</th></tr>
111 <tr><td><code>=</code> or <code>==</code></td>
112         <td><var>version</var> has the form
113             <code>/<var>regex</var>/</code></td></tr>
114 <tr class="odd"><td><code>~</code></td>
115         <td><var>version</var> has the form
116             <code><var>regex</var></code></td></tr>
117 </table>
118
119     <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">&lt;IfVersion = /^2.4.[01234]$/&gt;
120     # e.g. workaround for buggy versions
121 &lt;/IfVersion&gt;</pre>
122 </div>
123
124     <p>In order to reverse the meaning, all operators can be preceded by an
125     exclamation mark (<code>!</code>):</p>
126
127     <pre class="prettyprint lang-config">&lt;IfVersion !~ ^2.4.[01234]$&gt;
128     # not for those versions
129 &lt;/IfVersion&gt;</pre>
130
131
132     <p>If the <var>operator</var> is omitted, it is assumed to be
133     <code>=</code>.</p>
134
135 </div>
136 </div>
137 <div class="bottomlang">
138 <p><span>Available Languages: </span><a href="../en/mod/mod_version.html" title="English">&nbsp;en&nbsp;</a> |
139 <a href="../fr/mod/mod_version.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
140 <a href="../ja/mod/mod_version.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
141 <a href="../ko/mod/mod_version.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
142 </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&amp;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>
143 <script type="text/javascript"><!--//--><![CDATA[//><!--
144 var comments_shortname = 'httpd';
145 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_version.html';
146 (function(w, d) {
147     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
148         d.write('<div id="comments_thread"><\/div>');
149         var s = d.createElement('script');
150         s.type = 'text/javascript';
151         s.async = true;
152         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
153         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
154     }
155     else {
156         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
157     }
158 })(window, document);
159 //--><!]]></script></div><div id="footer">
160 <p class="apache">Copyright 2017 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>
161 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.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[//><!--
162 if (typeof(prettyPrint) !== 'undefined') {
163     prettyPrint();
164 }
165 //--><!]]></script>
166 </body></html>