1<?xml version="1.0" encoding="UTF-8"?> 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="ja" xml:lang="ja"><head><!-- 4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 This file is generated from xml source: DO NOT EDIT 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 --> 8<title>mod_version - Apache HTTP サーバ</title> 9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 11<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" /> 12<script src="/style/scripts/prettify.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body> 17<div id="page-header"> 18<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p> 19<p class="apache">Apache HTTP サーバ バージョン 2.2</p> 20<img alt="" src="/images/feather.gif" /></div> 21<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 22<div id="path"> 23<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP サーバ</a> > <a href="http://httpd.apache.org/docs/">ドキュメンテーション</a> > <a href="../">バージョン 2.2</a> > <a href="./">モジュール</a></div> 24<div id="page-content"> 25<div id="preamble"><h1>Apache モジュール mod_version</h1> 26<div class="toplang"> 27<p><span>翻訳済み言語: </span><a href="/en/mod/mod_version.html" hreflang="en" rel="alternate" title="English"> en </a> | 28<a href="/ja/mod/mod_version.html" title="Japanese"> ja </a> | 29<a href="/ko/mod/mod_version.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 30</div> 31<table class="module"><tr><th><a href="module-dict.html#Description">説明:</a></th><td>バージョン依存の設定</td></tr> 32<tr><th><a href="module-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 33<tr><th><a href="module-dict.html#ModuleIdentifier">モジュール識別子:</a></th><td>version_module</td></tr> 34<tr><th><a href="module-dict.html#SourceFile">ソースファイル:</a></th><td>mod_version.c</td></tr> 35<tr><th><a href="module-dict.html#Compatibility">互換性:</a></th><td>Apache 2.0.56 以降で使用可能</td></tr></table> 36<h3>概要</h3> 37 38 <p>様々なバージョンの httpd の異なる設定を扱うことになる、 39 テストスイートや大規模ネットワークでの使用のために設計されています。 40 このモジュールは新しいコンテナ ― <code class="directive"><a href="#ifversion"><IfVersion></a></code> を 41 提供します。これを使うと、数字の比較や正規表現による柔軟な 42 バージョンチェックができるようになります。</p> 43 44 <div class="example"><h3>例</h3><p><code> 45 <IfVersion 2.1.0><br /> 46 <span class="indent"> 47 # current httpd version is exactly 2.1.0<br /> 48 </span> 49 </IfVersion><br /> 50 <br /> 51 <IfVersion >= 2.2><br /> 52 <span class="indent"> 53 # use really new features :-)<br /> 54 </span> 55 </IfVersion> 56 </code></p></div> 57 58 <p>詳細は以下を読んでください。</p> 59</div> 60<div id="quickview"><h3 class="directives">ディレクティブ</h3> 61<ul id="toc"> 62<li><img alt="" src="/images/down.gif" /> <a href="#ifversion"><IfVersion></a></li> 63</ul> 64<ul class="seealso"><li><a href="#comments_section">コメント</a></li></ul></div> 65 66<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 67<div class="directive-section"><h2><a name="IfVersion" id="IfVersion"><IfVersion></a> <a name="ifversion" id="ifversion">ディレクティブ</a></h2> 68<table class="directive"> 69<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>バージョン依存の設定を入れる</td></tr> 70<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code><IfVersion [[!]<var>operator</var>] <var>version</var>> ... 71</IfVersion></code></td></tr> 72<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト, ディレクトリ, .htaccess</td></tr> 73<tr><th><a href="directive-dict.html#Override">上書き:</a></th><td>All</td></tr> 74<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr> 75<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_version</td></tr> 76</table> 77 <p><code class="directive"><IfVersion></code> は <code class="program"><a href="/programs/httpd.html">httpd</a></code> のバージョン 78 が基準を満たしたときにのみ実行させたいディレクティブを囲みます。 79 通常の (数値) 比較のときは <var>version</var> 引数は 80 <code><var>major</var>[.<var>minor</var>[.<var>patch</var>]]</code> という 81 形式、例えば、<code>2.1.0</code> や <code>2.2</code> となります。 82 <var>minor</var> と <var>patch</var> は省略可能です。省略された場合は、 83 0 を指定したものとみなされます。比較には次の数値 <var>operator</var> を 84 指定できます:</p> 85 86 <table class="bordered"><tr class="header"><th><var>operator</var></th><th>説明</th></tr> 87<tr><td><code>=</code> と <code>==</code></td> 88 <td>同じ httpd バージョン</td></tr> 89<tr class="odd"><td><code>></code></td> 90 <td>より大きい httpd バージョン</td></tr> 91<tr><td><code>>=</code></td> 92 <td>指定以上の httpd バージョン</td></tr> 93<tr class="odd"><td><code><</code></td> 94 <td>指定未満の httpd バージョン</td></tr> 95<tr><td><code><=</code></td> 96 <td>指定以下の httpd バージョン</td></tr> 97</table> 98 99 <div class="example"><h3>例</h3><p><code> 100 <IfVersion >= 2.1><br /> 101 <span class="indent"> 102 # this happens only in versions greater or<br /> 103 # equal 2.1.0.<br /> 104 </span> 105 </IfVersion> 106 </code></p></div> 107 108 <p>数値比較に加えて、http のバージョン番号に対して 109 <a class="glossarylink" href="/glossary.html#regex" title="用語集を参照">正規表現</a> による 110 マッチングができます。二種類の書き方があります:</p> 111 112 <table class="bordered"><tr class="header"><th><var>operator</var></th><th>説明</th></tr> 113<tr><td><code>=</code> or <code>==</code></td> 114 <td><var>version</var> は 115 <code>/<var>regex</var>/</code> 形式</td></tr> 116<tr class="odd"><td><code>~</code></td> 117 <td><var>version</var> は 118 <code><var>regex</var></code> 形式</td></tr> 119</table> 120 121 <div class="example"><h3>例</h3><p><code> 122 <IfVersion = /^2.1.[01234]$/><br /> 123 <span class="indent"> 124 # e.g. workaround for buggy versions 125 </span> 126 </IfVersion> 127 </code></p></div> 128 129 <p>マッチングの否定を表現するために、すべてのオペレータは前に 130 感嘆符 (<code>!</code>)を付けることができます:</p> 131 132 <div class="example"><p><code> 133 <IfVersion !~ ^2.1.[01234]$><br /> 134 <span class="indent"> 135 # not for those versions<br /> 136 </span> 137 </IfVersion> 138 </code></p></div> 139 140 <p><var>operator</var> が省略されたときは <code>=</code> と 141 みなされます。</p> 142 143</div> 144</div> 145<div class="bottomlang"> 146<p><span>翻訳済み言語: </span><a href="/en/mod/mod_version.html" hreflang="en" rel="alternate" title="English"> en </a> | 147<a href="/ja/mod/mod_version.html" title="Japanese"> ja </a> | 148<a href="/ko/mod/mod_version.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 149</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">コメント</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&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> 150<script type="text/javascript"><!--//--><![CDATA[//><!-- 151var comments_shortname = 'httpd'; 152var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_version.html'; 153(function(w, d) { 154 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 155 d.write('<div id="comments_thread"><\/div>'); 156 var s = d.createElement('script'); 157 s.type = 'text/javascript'; 158 s.async = true; 159 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 160 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 161 } 162 else { 163 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 164 } 165})(window, document); 166//--><!]]></script></div><div id="footer"> 167<p class="apache">Copyright 2013 The Apache Software Foundation.<br />この文書は <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> のライセンスで提供されています。.</p> 168<p class="menu"><a href="/mod/">モジュール</a> | <a href="/mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">用語</a> | <a href="/sitemap.html">サイトマップ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 169if (typeof(prettyPrint) !== 'undefined') { 170 prettyPrint(); 171} 172//--><!]]></script> 173</body></html>