mod_actions.xml revision f80e267f416eda70d74550e77b11bdc42ecd104d
530eba85dbd41b8a0fa5255d3648d1440199a661slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<modulesynopsis>
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding<description>This module provides for executing CGI scripts based on
db479b48bd4d75423ed4a45e15b75089d1a8ad72fieldingmedia type or request method.</description>
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>
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>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
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 <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 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 # Requests for files of a particular type:<br />
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna # Files of a particular file extension<br />
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna AddHandler my-file-type .xyz<br />
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 <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<seealso><directive module="mod_mime">AddHandler</directive></seealso>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna</directivesynopsis>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<directivesynopsis>
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 <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 file path of the requested document is sent using the standard CGI
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe PATH_INFO and PATH_TRANSLATED environment variables.</p>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe Any arbitrary method name may be used. <strong>Method names are
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe case-sensitive</strong>, so <code>Script PUT</code> and
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>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess # For <ISINDEX>-style searching<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive # A CGI PUT handler<br />
88d86cfadffe2275a3dfb67a4d7bdc018630b661rbowen</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</modulesynopsis>