blob: 9199fb967804e2c6fbf0ebe72442ef86ed71ca49 [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: 420990:1673563 (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_actions.xml.meta">
<name>mod_actions</name>
<description>メディアタイプやリクエストメソッドに応じて
CGI スクリプトを実行する機能を提供</description>
<status>Base</status>
<sourcefile>mod_actions.c</sourcefile>
<identifier>actions_module</identifier>
<summary>
<p>このモジュールには二つのディレクティブがあります。<directive
module="mod_actions">Action</directive>
ディレクティブは特定の <glossary ref="mime-type">MIME タイプ</glossary>のファイルをリクエストされた場合に
CGI スクリプトが実行されるようにします。<directive
module="mod_actions">Script</directive>
ディレクティブはリクエストで特定のメソッドが使用されたときに CGI
スクリプトが実行されるようにします。
これはファイルを処理するスクリプトの実行をずっと簡単にします。</p>
</summary>
<seealso><module>mod_cgi</module></seealso>
<seealso><a href="../howto/cgi.html">CGI による動的コンテンツ</a></seealso>
<seealso><a href="../handler.html">Apache のハンドラの使用</a></seealso>
<directivesynopsis>
<name>Action</name>
<description>特定のハンドラやコンテントタイプに対して CGI を実行するように
設定</description>
<syntax>Action <var>action-type</var> <var>cgi-script</var> [virtual]</syntax>
<contextlist>
<context>server config</context><context>virtual host</context>
<context>directory</context><context>.htaccess</context>
</contextlist>
<override>FileInfo</override>
<compatibility><code>virtual</code> 修飾子とハンドラ渡しは
Apache 2.1 で導入されました</compatibility>
<usage>
<p>このディレクティブは <var>action-type</var>
がリクエストされたときに <var>cgi-script</var>
が実行されるという動作を追加します。<var>cgi-script</var>
<directive module="mod_alias">ScriptAlias</directive>
<directive module="mod_mime">AddHandler</directive> によって
CGI スクリプトに設定されたリソースへの URL-path です。
<var>Action-type</var> には
<a href="../handler.html">handler</a><glossary ref="mime-type">MIME
コンテントタイプ</glossary>を指定できます。リクエストされたドキュメントの URL
とファイルのパスは標準 CGI 環境変数 <code>PATH_INFO</code>
<code>PATH_TRANSLATED</code> を使って伝えられます。
特定のリクエストに対して使用されるハンドラへは、
<code>REDIRECT_HANDLER</code> 変数を使って渡せます。</p>
<example><title></title>
# Requests for files of a particular MIME content type:<br />
Action image/gif /cgi-bin/images.cgi<br />
<br />
# Files of a particular file extension<br />
AddHandler my-file-type .xyz<br />
Action my-file-type /cgi-bin/program.cgi<br />
</example>
<p>最初の例では、MIME コンテントタイプが <code>image/gif</code>
のファイルへのリクエストは、指定したスクリプト
<code>/cgi-bin/images.cgi</code> で処理されます。</p>
<p>2 番目の例では、拡張子が <code>.xyz</code>
のファイルへのリクエストは、指定したスクリプト
<code>/cgi-bin/program.cgi</code> で処理されます。</p>
<p>オプションの <code>virtual</code> 修飾子を使用すると、
リクエストされたファイルが実際に存在するかどうかを検査しないようにできます。
これは例えば、<directive>Action</directive> ディレクティブをバーチャルな
Location に使用したい、といった場合に便利です。</p>
<example><title></title>
&lt;Location /news&gt;<br />
<indent>
SetHandler news-handler<br />
Action news-handler /cgi-bin/news.cgi virtual<br />
</indent>
&lt;/Location&gt;
</example>
</usage>
<seealso><directive module="mod_mime">AddHandler</directive></seealso>
</directivesynopsis>
<directivesynopsis>
<name>Script</name>
<description>特定のリクエストメソッドに対して CGI スクリプトを
実行するように設定</description>
<syntax>Script <var>method</var> <var>cgi-script</var></syntax>
<contextlist>
<context>server config</context><context>virtual host</context>
<context>directory</context></contextlist>
<usage>
<p>このディレクティブは <var>method</var>
というメソッドを使ってリクエストが行なわれたときに
<var>cgi-script</var> を実行するという動作を追加します。
<var>cgi-script</var>
<directive module="mod_alias">ScriptAlias</directive>
<directive module="mod_mime">AddHandler</directive> によって
CGI スクリプトに設定されたリソースへの URL-path です。
リクエストされたドキュメントの URL とファイルのパスは標準 CGI
環境変数 <code>PATH_INFO</code><code>PATH_TRANSLATED</code>
を使って伝えられます。</p>
<note>
任意のメソッド名を使用することができます。
<strong>メソッド名は大文字小文字を区別します</strong>。ですから、
<code>Script PUT</code><code>Script put</code>
はまったく違った効果になります。
</note>
<p><directive>Script</directive> コマンドはデフォルトの動作を
追加するだけであることに
注意してください。もし CGI スクリプトが呼ばれたり、リクエストされた
メソッドを内部で扱うことのできる他のリソースがあれば、それが行なわれます。
<code>GET</code> メソッドの <directive>Script</directive> は問合せ
引数がある場合にのみ
(<em>たとえば</em>、foo.html?hi) 呼ばれるということにも注意してください。
そうでない場合は、リクエストは通常通り処理されます。</p>
<example><title></title>
# For &lt;ISINDEX&gt;-style searching<br />
Script GET /cgi-bin/search<br />
<br />
# A CGI PUT handler<br />
Script PUT /~bob/put.cgi<br />
</example>
</usage>
</directivesynopsis>
</modulesynopsis>