1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
4 <!-- English Revision: 1421821 -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_version.xml.meta">
24 <name>mod_version</name>
25 <description>バージョン依存の設定</description>
26 <status>Extension</status>
27 <sourcefile>mod_version.c</sourcefile>
28 <identifier>version_module</identifier>
31 <p>様々なバージョンの httpd の異なる設定を扱うことになる、
32 テストスイートや大規模ネットワークでの使用のために設計されています。
33 このモジュールは新しいコンテナ ― <directive
34 type="section" module="mod_version">IfVersion</directive> を
35 提供します。これを使うと、数字の比較や正規表現による柔軟な
36 バージョンチェックができるようになります。</p>
38 <example><title>例</title>
39 <highlight language="config">
40 <IfVersion 2.4.2>
41 # current httpd version is exactly 2.4.2
44 <IfVersion >= 2.5>
45 # use really new features :-)
53 <directivesynopsis type="section">
54 <name>IfVersion</name>
55 <description>バージョン依存の設定を入れる</description>
56 <syntax><IfVersion [[!]<var>operator</var>] <var>version</var>> ...
57 </IfVersion></syntax>
58 <contextlist><context>server config</context><context>virtual host</context>
59 <context>directory</context><context>.htaccess</context></contextlist>
60 <override>All</override>
63 <p><directive type="section">IfVersion</directive> は <program>httpd</program> のバージョン
64 が基準を満たしたときにのみ実行させたいディレクティブを囲みます。
65 通常の (数値) 比較のときは <var>version</var> 引数は
66 <code><var>major</var>[.<var>minor</var>[.<var>patch</var>]]</code> という
67 形式、例えば、<code>2.1.0</code> や <code>2.2</code> となります。
68 <var>minor</var> と <var>patch</var> は省略可能です。省略された場合は、
69 0 を指定したものとみなされます。比較には次の数値 <var>operator</var> を
72 <table style="zebra" border="1">
73 <tr><th><var>operator</var></th><th>説明</th></tr>
74 <tr><td><code>=</code> と <code>==</code></td>
75 <td>同じ httpd バージョン</td></tr>
76 <tr><td><code>></code></td>
77 <td>より大きい httpd バージョン</td></tr>
78 <tr><td><code>>=</code></td>
79 <td>指定以上の httpd バージョン</td></tr>
80 <tr><td><code><</code></td>
81 <td>指定未満の httpd バージョン</td></tr>
82 <tr><td><code><=</code></td>
83 <td>指定以下の httpd バージョン</td></tr>
86 <example><title>例</title>
87 <highlight language="config">
88 <IfVersion >= 2.3>
89 # this happens only in versions greater or
95 <p>数値比較に加えて、http のバージョン番号に対して
96 <glossary ref="regex">正規表現</glossary>による
97 マッチングができます。二種類の書き方があります:</p>
99 <table style="zebra" border="1">
100 <tr><th><var>operator</var></th><th>説明</th></tr>
101 <tr><td><code>=</code> or <code>==</code></td>
102 <td><var>version</var> は
103 <code>/<var>regex</var>/</code> 形式</td></tr>
104 <tr><td><code>~</code></td>
105 <td><var>version</var> は
106 <code><var>regex</var></code> 形式</td></tr>
109 <example><title>例</title>
110 <highlight language="config">
111 <IfVersion = /^2.4.[01234]$/>
112 # e.g. workaround for buggy versions
117 <p>マッチングの否定を表現するために、すべてのオペレータは前に
118 感嘆符 (<code>!</code>)を付けることができます:</p>
120 <highlight language="config">
121 <IfVersion !~ ^2.4.[01234]$>
122 # not for those versions
126 <p><var>operator</var> が省略されたときは <code>=</code> と