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: 420990:1437836 (outdated) -->
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_actions.xml.meta">
25 <name>mod_actions</name>
27 <description>メディアタイプやリクエストメソッドに応じて
28 CGI スクリプトを実行する機能を提供</description>
31 <sourcefile>mod_actions.c</sourcefile>
32 <identifier>actions_module</identifier>
35 <p>このモジュールには二つのディレクティブがあります。<directive
36 module="mod_actions">Action</directive>
37 ディレクティブは特定の <glossary ref="mime-type">MIME タイプ</glossary>のファイルをリクエストされた場合に
38 CGI スクリプトが実行されるようにします。<directive
39 module="mod_actions">Script</directive>
40 ディレクティブはリクエストで特定のメソッドが使用されたときに CGI
42 これはファイルを処理するスクリプトの実行をずっと簡単にします。</p>
45 <seealso><module>mod_cgi</module></seealso>
46 <seealso><a href="../howto/cgi.html">CGI による動的コンテンツ</a></seealso>
47 <seealso><a href="../handler.html">Apache のハンドラの使用</a></seealso>
51 <description>特定のハンドラやコンテントタイプに対して CGI を実行するように
53 <syntax>Action <var>action-type</var> <var>cgi-script</var> [virtual]</syntax>
55 <context>server config</context><context>virtual host</context>
56 <context>directory</context><context>.htaccess</context>
58 <override>FileInfo</override>
59 <compatibility><code>virtual</code> 修飾子とハンドラ渡しは
60 Apache 2.1 で導入されました</compatibility>
63 <p>このディレクティブは <var>action-type</var>
64 がリクエストされたときに <var>cgi-script</var>
65 が実行されるという動作を追加します。<var>cgi-script</var> は
66 <directive module="mod_alias">ScriptAlias</directive> や
67 <directive module="mod_mime">AddHandler</directive> によって
68 CGI スクリプトに設定されたリソースへの URL-path です。
69 <var>Action-type</var> には
70 <a href="../handler.html">handler</a> か <glossary ref="mime-type">MIME
71 コンテントタイプ</glossary>を指定できます。リクエストされたドキュメントの URL
72 とファイルのパスは標準 CGI 環境変数 <code>PATH_INFO</code> と
73 <code>PATH_TRANSLATED</code> を使って伝えられます。
74 特定のリクエストに対して使用されるハンドラへは、
75 <code>REDIRECT_HANDLER</code> 変数を使って渡せます。</p>
77 <example><title>例</title>
78 # Requests for files of a particular MIME content type:<br />
79 Action image/gif /cgi-bin/images.cgi<br />
81 # Files of a particular file extension<br />
82 AddHandler my-file-type .xyz<br />
83 Action my-file-type /cgi-bin/program.cgi<br />
86 <p>最初の例では、MIME コンテントタイプが <code>image/gif</code>
87 のファイルへのリクエストは、指定したスクリプト
88 <code>/cgi-bin/images.cgi</code> で処理されます。</p>
90 <p>2 番目の例では、拡張子が <code>.xyz</code>
91 のファイルへのリクエストは、指定したスクリプト
92 <code>/cgi-bin/program.cgi</code> で処理されます。</p>
94 <p>オプションの <code>virtual</code> 修飾子を使用すると、
95 リクエストされたファイルが実際に存在するかどうかを検査しないようにできます。
96 これは例えば、<directive>Action</directive> ディレクティブをバーチャルな
97 Location に使用したい、といった場合に便利です。</p>
99 <example><title>例</title>
100 <Location /news><br />
102 SetHandler news-handler<br />
103 Action news-handler /cgi-bin/news.cgi virtual<br />
109 <seealso><directive module="mod_mime">AddHandler</directive></seealso>
114 <description>特定のリクエストメソッドに対して CGI スクリプトを
115 実行するように設定</description>
116 <syntax>Script <var>method</var> <var>cgi-script</var></syntax>
118 <context>server config</context><context>virtual host</context>
119 <context>directory</context></contextlist>
121 <p>このディレクティブは <var>method</var>
122 というメソッドを使ってリクエストが行なわれたときに
123 <var>cgi-script</var> を実行するという動作を追加します。
124 <var>cgi-script</var> は
125 <directive module="mod_alias">ScriptAlias</directive> や
126 <directive module="mod_mime">AddHandler</directive> によって
127 CGI スクリプトに設定されたリソースへの URL-path です。
128 リクエストされたドキュメントの URL とファイルのパスは標準 CGI
129 環境変数 <code>PATH_INFO</code> と <code>PATH_TRANSLATED</code>
133 任意のメソッド名を使用することができます。
134 <strong>メソッド名は大文字小文字を区別します</strong>。ですから、
135 <code>Script PUT</code> と <code>Script put</code>
139 <p><directive>Script</directive> コマンドはデフォルトの動作を
141 注意してください。もし CGI スクリプトが呼ばれたり、リクエストされた
142 メソッドを内部で扱うことのできる他のリソースがあれば、それが行なわれます。
143 <code>GET</code> メソッドの <directive>Script</directive> は問合せ
145 (<em>たとえば</em>、foo.html?hi) 呼ばれるということにも注意してください。
146 そうでない場合は、リクエストは通常通り処理されます。</p>
148 <example><title>例</title>
149 # For <ISINDEX>-style searching<br />
150 Script GET /cgi-bin/search<br />
152 # A CGI PUT handler<br />
153 Script PUT /~bob/put.cgi<br />