summaryrefslogtreecommitdiff
path: root/docs/manual/mod/mod_actions.xml.ja
blob: 9199fb967804e2c6fbf0ebe72442ef86ed71ca49 (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?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>