summaryrefslogtreecommitdiff
path: root/docs/manual/mod/mod_version.xml.ja
blob: 60742aacdff59c10c16b74aa0e0e996cd5a217d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?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: 151408:421174 (outdated) -->

<!--
 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>
<compatibility>バージョン 2.0.54 以降</compatibility>

<summary>
    <p>様々なバージョンの httpd の異なる設定を扱うことになる、
    テストスイートや大規模ネットワークでの使用のために設計されています。
    このモジュールは新しいコンテナ ― <directive
    type="section" module="mod_version">IfVersion</directive> を
    提供します。これを使うと、数字の比較や正規表現による柔軟な
    バージョンチェックができるようになります。</p>

    <example><title>例</title>
      &lt;IfVersion 2.1.0&gt;<br />
      <indent>
        # current httpd version is exactly 2.1.0<br />
      </indent>
      &lt;/IfVersion&gt;<br />
      <br />
      &lt;IfVersion >= 2.2&gt;<br />
      <indent>
        # use really new features :-)<br />
      </indent>
      &lt;/IfVersion&gt;
    </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>
      &lt;IfVersion >= 2.1&gt;<br />
      <indent>
        # this happens only in versions greater or<br />
        # equal 2.1.0.<br />
      </indent>
      &lt;/IfVersion&gt;
    </example>

    <p>数値比較に加えて、http のバージョン番号に対して正規表現による
    マッチングができます。二種類の書き方があります:</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>
      &lt;IfVersion = /^2.1.[01234]$/&gt;<br />
      <indent>
        # e.g. workaround for buggy versions
      </indent>
      &lt;/IfVersion&gt;
    </example>

    <p>マッチングの否定を表現するために、すべてのオペレータは前に
    感嘆符 (<code>!</code>)を付けることができます:</p>

    <example>
      &lt;IfVersion !~ ^2.1.[01234]$&gt;<br />
      <indent>
        # not for those versions<br />
      </indent>
      &lt;/IfVersion&gt;
    </example>

    <p><var>operator</var> が省略されたときは <code>=</code> と
    みなされます。</p>
</usage>
</directivesynopsis>

</modulesynopsis>