]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_actions.html.en
update transformation
[apache] / docs / manual / mod / mod_actions.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
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="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_actions - Apache HTTP Server</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" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.1</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs-project/">Documentation</a> &gt; <a href="../">Version 2.1</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_actions</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_actions.html" title="English">&nbsp;en&nbsp;</a> |
25 <a href="../ja/mod/mod_actions.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
26 <a href="../ko/mod/mod_actions.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
27 </div>
28 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>This module provides for executing CGI scripts based on
29 media type or request method.</td></tr>
30 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
31 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>actions_module</td></tr>
32 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_actions.c</td></tr></table>
33 <h3>Summary</h3>
34
35     <p>This module has two directives. The <code class="directive"><a href="#action">Action</a></code> directive lets you run CGI
36     scripts whenever a file of a certain type is requested. The
37     <code class="directive"><a href="#script">Script</a></code> directive lets
38     you run CGI scripts whenever a particular method is used in a
39     request. This makes it much easier to execute scripts that process
40     files.</p>
41 </div>
42 <div id="quickview"><h3 class="directives">Directives</h3>
43 <ul id="toc">
44 <li><img alt="" src="../images/down.gif" /> <a href="#action">Action</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#script">Script</a></li>
46 </ul>
47 <h3>See also</h3>
48 <ul class="seealso">
49 <li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li>
50 <li><a href="../howto/cgi.html">Dynamic Content with CGI</a></li>
51 <li><a href="../handler.html">Apache's Handler Use</a></li>
52 </ul></div>
53
54 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
55 <div class="directive-section"><h2><a name="Action" id="Action">Action</a> <a name="action" id="action">Directive</a></h2>
56 <table class="directive">
57 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Activates a CGI script for a particular handler or
58 content-type</td></tr>
59 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Action <var>action-type</var> <var>cgi-script</var> [virtual]</code></td></tr>
60 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
61 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
62 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
63 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_actions</td></tr>
64 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The <code>virtual</code> modifier was introduced in Apache
65 2.1</td></tr>
66 </table>
67     <p>This directive adds an action, which will activate
68     <var>cgi-script</var> when <var>action-type</var> is triggered by the
69     request.  The <var>cgi-script</var> is the URL-path to a resource
70     that has been designated as a CGI script using <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> or <code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code>.  The
71     <var>action-type</var> can be either a <a href="../handler.html">handler</a> or a MIME content type. It
72     sends the URL and file path of the requested document using the
73     standard CGI PATH_INFO and PATH_TRANSLATED environment
74     variables.</p>
75
76     <div class="example"><h3>Examples</h3><p><code>
77       # Requests for files of a particular type:<br />
78       Action image/gif /cgi-bin/images.cgi<br />
79       <br />
80       # Files of a particular file extension<br />
81       AddHandler my-file-type .xyz<br />
82       Action my-file-type /cgi-bin/program.cgi<br />
83     </code></p></div>
84
85     <p>In the first example, requests for files with a MIME content
86     type of <code>image/gif</code> will instead be handled by the
87     specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
88
89     <p>In the second example, requests for files with a file extension of
90     <code>.xyz</code> are handled instead by the specified cgi script 
91     <code>/cgi-bin/program.cgi</code>.</p>
92
93     <p>The optional <code>virtual</code> modifier turns off the check
94     whether the requested file really exists. This is useful, for example,
95     if you want to use the <code class="directive">Action</code> directive in
96     virtual locations.</p>
97
98     <div class="example"><h3>Example</h3><p><code>
99       &lt;Location /news&gt;<br />
100       <span class="indent">
101         SetHandler news-handler
102         Action news-handler /cgi-bin/news.cgi virtual
103       </span>
104       &lt;/Location&gt;
105     </code></p></div>
106
107 <h3>See also</h3>
108 <ul>
109 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
110 </ul>
111 </div>
112 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
113 <div class="directive-section"><h2><a name="Script" id="Script">Script</a> <a name="script" id="script">Directive</a></h2>
114 <table class="directive">
115 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Activates a CGI script for a particular request
116 method.</td></tr>
117 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Script <var>method</var> <var>cgi-script</var></code></td></tr>
118 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
119 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
120 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_actions</td></tr>
121 </table>
122     <p>This directive adds an action, which will activate
123     <var>cgi-script</var> when a file is requested using the method of
124     <var>method</var>. The <var>cgi-script</var> is the URL-path to a
125     resource that has been designated as a CGI script using <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> or <code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code>.  The URL and
126     file path of the requested document is sent using the standard CGI
127     PATH_INFO and PATH_TRANSLATED environment variables.</p>
128
129     <div class="note">
130       Any arbitrary method name may be used. <strong>Method names are
131       case-sensitive</strong>, so <code>Script PUT</code> and
132       <code>Script put</code> have two entirely different
133       effects.
134     </div>
135
136     <p>Note that the Script command defines default actions only.
137     If a CGI script is called, or some other resource that is
138     capable of handling the requested method internally, it will do
139     so. Also note that Script with a method of <code>GET</code>
140     will only be called if there are query arguments present
141     (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
142     proceed normally.</p>
143
144     <div class="example"><h3>Examples</h3><p><code>
145       # For &lt;ISINDEX&gt;-style searching<br />
146       Script GET /cgi-bin/search<br />
147       <br />
148       # A CGI PUT handler<br />
149       Script PUT /~bob/put.cgi<br />
150     </code></p></div>
151
152 </div>
153 </div>
154 <div class="bottomlang">
155 <p><span>Available Languages: </span><a href="../en/mod/mod_actions.html" title="English">&nbsp;en&nbsp;</a> |
156 <a href="../ja/mod/mod_actions.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
157 <a href="../ko/mod/mod_actions.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
158 </div><div id="footer">
159 <p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
160 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
161 </body></html>