mod_actions.xml revision f80e267f416eda70d74550e77b11bdc42ecd104d
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<?xml version="1.0"?>
530eba85dbd41b8a0fa5255d3648d1440199a661slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<modulesynopsis>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<name>mod_actions</name>
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding<description>This module provides for executing CGI scripts based on
db479b48bd4d75423ed4a45e15b75089d1a8ad72fieldingmedia type or request method.</description>
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding<status>Base</status>
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding<sourcefile>mod_actions.c</sourcefile>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<identifier>actions_module</identifier>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<summary>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd <p>This module has two directives. The <directive
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd module="mod_actions">Action</directive> directive lets you run CGI
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd scripts whenever a file of a certain type is requested. The
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd <directive module="mod_actions">Script</directive> directive lets
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd you run CGI scripts whenever a particular method is used in a
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd request. This makes it much easier to execute scripts that process
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd files.</p>
7db9f691a00ead175b03335457ca296a33ddf31bnd</summary>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><module>mod_cgi</module></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/howto/cgi.html">Dynamic Content with CGI</a></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/handler.html">Apache's Handler Use</a></seealso>
530eba85dbd41b8a0fa5255d3648d1440199a661slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<name>Action</name>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<description>Activates a CGI script for a particular handler or
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquernacontent-type</description>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<syntax>Action <var>action-type</var> <var>cgi-script</var></syntax>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<contextlist>
88d86cfadffe2275a3dfb67a4d7bdc018630b661rbowen<context>server config</context><context>virtual host</context>
88d86cfadffe2275a3dfb67a4d7bdc018630b661rbowen<context>directory</context><context>.htaccess</context>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna</contextlist>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<override>FileInfo</override>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<usage>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <p>This directive adds an action, which will activate
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <var>cgi-script</var> when <var>action-type</var> is triggered by the
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna request. The <var>cgi-script</var> is the URL-path to a resource
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe that has been designated as a CGI script using <directive
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe module="mod_alias">ScriptAlias</directive> or <directive
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe module="mod_mime">AddHandler</directive>. The
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <var>action-type</var> can be either a <a
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe href="/handler.html">handler</a> or a MIME content type. It
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe sends the URL and file path of the requested document using the
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe standard CGI PATH_INFO and PATH_TRANSLATED environment
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe variables.</p>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <example><title>Examples</title>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna # Requests for files of a particular type:<br />
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna Action image/gif /cgi-bin/images.cgi<br />
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <br />
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna # Files of a particular file extension<br />
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna AddHandler my-file-type .xyz<br />
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna Action my-file-type /cgi-bin/program.cgi<br />
90efa9f1730742d874edb5a7803adce11c9f08eanoodl </example>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <p>In the first example, requests for files with a MIME content
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna type of <code>image/gif</code> will instead be handled by the
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <p>In the second example, requests for files with a file extension of
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <code>.xyz</code> are handled instead by the specified cgi script
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <code>/cgi-bin/program.cgi</code>.</p>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna</usage>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<seealso><directive module="mod_mime">AddHandler</directive></seealso>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna</directivesynopsis>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<directivesynopsis>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<name>Script</name>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<description>Activates a CGI script for a particular request
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquernamethod.</description>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<syntax>Script <var>method</var> <var>cgi-script</var></syntax>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<contextlist>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe<context>server config</context><context>virtual host</context>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe<context>directory</context></contextlist>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe<usage>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <p>This directive adds an action, which will activate
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <var>cgi-script</var> when a file is requested using the method of
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <var>method</var>. The <var>cgi-script</var> is the URL-path to a
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe resource that has been designated as a CGI script using <directive
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe module="mod_alias">ScriptAliase</directive> or <directive
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe module="mod_mime">AddHandler</directive>. The URL and
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe file path of the requested document is sent using the standard CGI
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe PATH_INFO and PATH_TRANSLATED environment variables.</p>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <note>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe Any arbitrary method name may be used. <strong>Method names are
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe case-sensitive</strong>, so <code>Script PUT</code> and
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <code>Script put</code> have two entirely different
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe effects.
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe </note>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <p>Note that the Script command defines default actions only.
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe If a CGI script is called, or some other resource that is
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe capable of handling the requested method internally, it will do
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna so. Also note that Script with a method of <code>GET</code>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna will only be called if there are query arguments present
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna proceed normally.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <example><title>Examples</title>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess # For &lt;ISINDEX&gt;-style searching<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Script GET /cgi-bin/search<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive # A CGI PUT handler<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Script PUT /~bob/put.cgi<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </example>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele</usage>
88d86cfadffe2275a3dfb67a4d7bdc018630b661rbowen</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</modulesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive