blob: ef1073fc30c536a85e3fb755535e3d5d19549197 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
<!-- English Revision: 1421892 -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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_version.xml.meta">
<name>mod_version</name>
<description>バージョン依存の設定</description>
<status>Extension</status>
<sourcefile>mod_version.c</sourcefile>
<identifier>version_module</identifier>
<summary>
<p>様々なバージョンの httpd の異なる設定を扱うことになる、
テストスイートや大規模ネットワークでの使用のために設計されています。
このモジュールは新しいコンテナ ― <directive
type="section" module="mod_version">IfVersion</directive>
提供します。これを使うと、数字の比較や正規表現による柔軟な
バージョンチェックができるようになります。</p>
<example><title></title>
<highlight language="config">
&lt;IfVersion 2.4.2&gt;
# current httpd version is exactly 2.4.2
&lt;/IfVersion&gt;
&lt;IfVersion >= 2.5&gt;
# use really new features :-)
&lt;/IfVersion&gt;
</highlight>
</example>
<p>詳細は以下を読んでください。</p>
</summary>
<directivesynopsis type="section">
<name>IfVersion</name>
<description>バージョン依存の設定を入れる</description>
<syntax>&lt;IfVersion [[!]<var>operator</var>] <var>version</var>&gt; ...
&lt;/IfVersion&gt;</syntax>
<contextlist><context>server config</context><context>virtual host</context>
<context>directory</context><context>.htaccess</context></contextlist>
<override>All</override>
<usage>
<p><directive type="section">IfVersion</directive><program>httpd</program> のバージョン
が基準を満たしたときにのみ実行させたいディレクティブを囲みます。
通常の (数値) 比較のときは <var>version</var> 引数は
<code><var>major</var>[.<var>minor</var>[.<var>patch</var>]]</code> という
形式、例えば、<code>2.1.0</code><code>2.2</code> となります。
<var>minor</var><var>patch</var> は省略可能です。省略された場合は、
0 を指定したものとみなされます。比較には次の数値 <var>operator</var>
指定できます:</p>
<table style="zebra" border="1">
<tr><th><var>operator</var></th><th>説明</th></tr>
<tr><td><code>=</code><code>==</code></td>
<td>同じ httpd バージョン</td></tr>
<tr><td><code>&gt;</code></td>
<td>より大きい httpd バージョン</td></tr>
<tr><td><code>&gt;=</code></td>
<td>指定以上の httpd バージョン</td></tr>
<tr><td><code>&lt;</code></td>
<td>指定未満の httpd バージョン</td></tr>
<tr><td><code>&lt;=</code></td>
<td>指定以下の httpd バージョン</td></tr>
</table>
<example><title></title>
<highlight language="config">
&lt;IfVersion >= 2.3&gt;
# this happens only in versions greater or
# equal 2.3.0.
&lt;/IfVersion&gt;
</highlight>
</example>
<p>数値比較に加えて、http のバージョン番号に対して
<glossary ref="regex">正規表現</glossary>による
マッチングができます。二種類の書き方があります:</p>
<table style="zebra" border="1">
<tr><th><var>operator</var></th><th>説明</th></tr>
<tr><td><code>=</code> or <code>==</code></td>
<td><var>version</var>
<code>/<var>regex</var>/</code> 形式</td></tr>
<tr><td><code>~</code></td>
<td><var>version</var>
<code><var>regex</var></code> 形式</td></tr>
</table>
<example><title></title>
<highlight language="config">
&lt;IfVersion = /^2.4.[01234]$/&gt;
# e.g. workaround for buggy versions
&lt;/IfVersion&gt;
</highlight>
</example>
<p>マッチングの否定を表現するために、すべてのオペレータは前に
感嘆符 (<code>!</code>)を付けることができます:</p>
<highlight language="config">
&lt;IfVersion !~ ^2.4.[01234]$&gt;
# not for those versions
&lt;/IfVersion&gt;
</highlight>
<p><var>operator</var> が省略されたときは <code>=</code>
みなされます。</p>
</usage>
</directivesynopsis>
</modulesynopsis>