mod_actions.xml revision a4031657b4020b74639885763e58576400c65c3d
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd<?xml version="1.0"?>
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd<modulesynopsis metafile="mod_actions.xml.meta">
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd<name>mod_actions</name>
5a58787efeb02a1c3f06569d019ad81fd2efa06end
5a58787efeb02a1c3f06569d019ad81fd2efa06end<description>This module provides for executing CGI scripts based on
5a58787efeb02a1c3f06569d019ad81fd2efa06endmedia type or request method.</description>
5a58787efeb02a1c3f06569d019ad81fd2efa06end
5a58787efeb02a1c3f06569d019ad81fd2efa06end<status>Base</status>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<sourcefile>mod_actions.c</sourcefile>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<identifier>actions_module</identifier>
5a58787efeb02a1c3f06569d019ad81fd2efa06end
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz<summary>
5a58787efeb02a1c3f06569d019ad81fd2efa06end <p>This module has two directives. The <directive
5a58787efeb02a1c3f06569d019ad81fd2efa06end module="mod_actions">Action</directive> directive lets you run CGI
5a58787efeb02a1c3f06569d019ad81fd2efa06end scripts whenever a file of a certain type is requested. The
4b5981e276e93df97c34e4da05ca5cf8bbd937dand <directive module="mod_actions">Script</directive> directive lets
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd you run CGI scripts whenever a particular method is used in a
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd request. This makes it much easier to execute scripts that process
f3ec420152ca921e4c1ce77782f51b53f659018dnd files.</p>
f3ec420152ca921e4c1ce77782f51b53f659018dnd</summary>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<seealso><module>mod_cgi</module></seealso>
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd<seealso><a href="/howto/cgi.html">Dynamic Content with CGI</a></seealso>
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd<seealso><a href="/handler.html">Apache's Handler Use</a></seealso>
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive<directivesynopsis>
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive<name>Action</name>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<description>Activates a CGI script for a particular handler or
5a58787efeb02a1c3f06569d019ad81fd2efa06endcontent-type</description>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<syntax>Action <var>action-type</var> <var>cgi-script</var> [virtual]</syntax>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<contextlist>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<context>server config</context><context>virtual host</context>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<context>directory</context><context>.htaccess</context>
5a58787efeb02a1c3f06569d019ad81fd2efa06end</contextlist>
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive<override>FileInfo</override>
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive<compatibility>The <code>virtual</code> modifier was introduced in Apache
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive2.1</compatibility>
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive<usage>
3a5c8a7c39f03520463a70cf3f90091dc3a1eb32nd <p>This directive adds an action, which will activate
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive <var>cgi-script</var> when <var>action-type</var> is triggered by the
5a58787efeb02a1c3f06569d019ad81fd2efa06end request. The <var>cgi-script</var> is the URL-path to a resource
5a58787efeb02a1c3f06569d019ad81fd2efa06end that has been designated as a CGI script using <directive
5a58787efeb02a1c3f06569d019ad81fd2efa06end module="mod_alias">ScriptAlias</directive> or <directive
bcb3a46ccb6553019068f7bb2a7ac8548a3f72cfslive module="mod_mime">AddHandler</directive>. The
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd <var>action-type</var> can be either a <a
0a146bb31945dd13e6f7ad35818f6842ec91ff53nd href="/handler.html">handler</a> or a MIME content type. It
5a58787efeb02a1c3f06569d019ad81fd2efa06end sends the URL and file path of the requested document using the
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd standard CGI PATH_INFO and PATH_TRANSLATED environment
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd variables.</p>
f3ec420152ca921e4c1ce77782f51b53f659018dnd
f3ec420152ca921e4c1ce77782f51b53f659018dnd <example><title>Examples</title>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd # Requests for files of a particular type:<br />
eac602f079a7b6a1039df751710a2c734c5f67cenoirin Action image/gif /cgi-bin/images.cgi<br />
5a58787efeb02a1c3f06569d019ad81fd2efa06end <br />
5a58787efeb02a1c3f06569d019ad81fd2efa06end # Files of a particular file extension<br />
AddHandler my-file-type .xyz<br />
Action my-file-type /cgi-bin/program.cgi<br />
</example>
<p>In the first example, requests for files with a MIME content
type of <code>image/gif</code> will instead be handled by the
specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
<p>In the second example, requests for files with a file extension of
<code>.xyz</code> are handled instead by the specified cgi script
<code>/cgi-bin/program.cgi</code>.</p>
<p>The optional <code>virtual</code> modifier turns off the check
whether the requested file really exists. This is useful, for example,
if you want to use the <directive>Action</directive> directive in
virtual locations.</p>
<example><title>Example</title>
&lt;Location /news&gt;<br />
<indent>
SetHandler news-handler
Action news-handler /cgi-bin/news.cgi virtual
</indent>
&lt;/Location&gt;
</example>
</usage>
<seealso><directive module="mod_mime">AddHandler</directive></seealso>
</directivesynopsis>
<directivesynopsis>
<name>Script</name>
<description>Activates a CGI script for a particular request
method.</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>This directive adds an action, which will activate
<var>cgi-script</var> when a file is requested using the method of
<var>method</var>. The <var>cgi-script</var> is the URL-path to a
resource that has been designated as a CGI script using <directive
module="mod_alias">ScriptAlias</directive> or <directive
module="mod_mime">AddHandler</directive>. The URL and
file path of the requested document is sent using the standard CGI
PATH_INFO and PATH_TRANSLATED environment variables.</p>
<note>
Any arbitrary method name may be used. <strong>Method names are
case-sensitive</strong>, so <code>Script PUT</code> and
<code>Script put</code> have two entirely different
effects.
</note>
<p>Note that the Script command defines default actions only.
If a CGI script is called, or some other resource that is
capable of handling the requested method internally, it will do
so. Also note that Script with a method of <code>GET</code>
will only be called if there are query arguments present
(<em>e.g.</em>, foo.html?hi). Otherwise, the request will
proceed normally.</p>
<example><title>Examples</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>