]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_actions.html.en
update xforms
[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.3</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/">Documentation</a> &gt; <a href="../">Version 2.3</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="../de/mod/mod_actions.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
25 <a href="../en/mod/mod_actions.html" title="English">&nbsp;en&nbsp;</a> |
26 <a href="../fr/mod/mod_actions.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
27 <a href="../ja/mod/mod_actions.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
28 <a href="../ko/mod/mod_actions.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
29 </div>
30 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>This module provides for executing CGI scripts based on
31 media type or request method.</td></tr>
32 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
33 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>actions_module</td></tr>
34 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_actions.c</td></tr></table>
35 <h3>Summary</h3>
36
37     <p>This module has two directives. The <code class="directive"><a href="#action">Action</a></code> directive lets you run CGI
38     scripts whenever a file of a certain <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME content type</a> is requested. The
39     <code class="directive"><a href="#script">Script</a></code> directive lets
40     you run CGI scripts whenever a particular method is used in a
41     request. This makes it much easier to execute scripts that process
42     files.</p> </div>
43 <div id="quickview"><h3 class="directives">Directives</h3>
44 <ul id="toc">
45 <li><img alt="" src="../images/down.gif" /> <a href="#action">Action</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#script">Script</a></li>
47 </ul>
48 <h3>See also</h3>
49 <ul class="seealso">
50 <li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li>
51 <li><a href="../howto/cgi.html">Dynamic Content with CGI</a></li>
52 <li><a href="../handler.html">Apache httpd's Handler Use</a></li>
53 </ul></div>
54
55 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
56 <div class="directive-section"><h2><a name="Action" id="Action">Action</a> <a name="action" id="action">Directive</a></h2>
57 <table class="directive">
58 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Activates a CGI script for a particular handler or
59 content-type</td></tr>
60 <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>
61 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
62 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
63 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
64 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_actions</td></tr>
65 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The <code>virtual</code> modifier and handler passing were
66 introduced in Apache 2.1</td></tr>
67 </table>
68     <p>This directive adds an action, which will activate
69     <var>cgi-script</var> when <var>action-type</var> is triggered by
70     the request.  The <var>cgi-script</var> is the URL-path to a
71     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
72     <var>action-type</var> can be either a <a href="../handler.html">handler</a> or a <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME content type</a>. It sends the URL and
73     file path of the requested document using the standard CGI
74     <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code>
75     environment variables. The handler used for the particular request
76     is passed using the <code>REDIRECT_HANDLER</code> variable.</p>
77
78     <div class="example"><h3>Example: MIME type</h3><p><code>
79       # Requests for files of a particular MIME content type:<br />
80       Action image/gif /cgi-bin/images.cgi<br />
81       <br />
82     </code></p></div>
83
84     <p>In this example, requests for files with a MIME content
85     type of <code>image/gif</code> will be handled by the
86     specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
87
88     <div class="example"><h3>Example: File extension</h3><p><code>
89       # Files of a particular file extension<br />
90       AddHandler my-file-type .xyz<br />
91       Action my-file-type /cgi-bin/program.cgi<br />
92     </code></p></div>
93
94     <p>In this example, requests for files with a file extension of
95     <code>.xyz</code> are handled by the specified cgi script
96     <code>/cgi-bin/program.cgi</code>.</p>
97
98     <p>The optional <code>virtual</code> modifier turns off the check
99     whether the requested file really exists. This is useful, for example,
100     if you want to use the <code class="directive">Action</code> directive in
101     virtual locations.</p>
102
103     <div class="example"><h3>Example</h3><p><code>
104       &lt;Location /news&gt;<br />
105       <span class="indent">
106         SetHandler news-handler<br />
107         Action news-handler /cgi-bin/news.cgi virtual<br />
108       </span>
109       &lt;/Location&gt;
110     </code></p></div>
111
112 <h3>See also</h3>
113 <ul>
114 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
115 </ul>
116 </div>
117 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
118 <div class="directive-section"><h2><a name="Script" id="Script">Script</a> <a name="script" id="script">Directive</a></h2>
119 <table class="directive">
120 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Activates a CGI script for a particular request
121 method.</td></tr>
122 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Script <var>method</var> <var>cgi-script</var></code></td></tr>
123 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
124 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
125 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_actions</td></tr>
126 </table>
127     <p>This directive adds an action, which will activate
128     <var>cgi-script</var> when a file is requested using the method of
129     <var>method</var>. The <var>cgi-script</var> is the URL-path to a
130     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
131     file path of the requested document is sent using the standard CGI
132     <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> environment
133     variables.</p>
134
135     <div class="note">
136       Any arbitrary method name may be used. <strong>Method names are
137       case-sensitive</strong>, so <code>Script PUT</code> and
138       <code>Script put</code> have two entirely different
139       effects.
140     </div>
141
142     <p>Note that the <code class="directive">Script</code> command defines default
143     actions only. If a CGI script is called, or some other resource that is
144     capable of handling the requested method internally, it will do
145     so. Also note that <code class="directive">Script</code> with a method of
146     <code>GET</code> will only be called if there are query arguments present
147     (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
148     proceed normally.</p>
149
150     <div class="example"><h3>Examples</h3><p><code>
151       # All GET requests go here<br />
152       Script GET /cgi-bin/search<br />
153       <br />
154       # A CGI PUT handler<br />
155       Script PUT /~bob/put.cgi<br />
156     </code></p></div>
157
158 </div>
159 </div>
160 <div class="bottomlang">
161 <p><span>Available Languages: </span><a href="../de/mod/mod_actions.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
162 <a href="../en/mod/mod_actions.html" title="English">&nbsp;en&nbsp;</a> |
163 <a href="../fr/mod/mod_actions.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
164 <a href="../ja/mod/mod_actions.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
165 <a href="../ko/mod/mod_actions.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
166 </div><div id="footer">
167 <p class="apache">Copyright 2011 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
168 <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>
169 </body></html>