mod_actions.xml revision d24d4c5159bcb11c25bb294926cfe7105c789ea9
22d5d84393d960a2027f472036f3fee15d7dbce9nd<?xml version="1.0"?>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
22d5d84393d960a2027f472036f3fee15d7dbce9nd<?xml-stylesheet type="text/xsl" href="/style/manual.xsl"?>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<modulesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<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>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<identifier>actions_module</identifier>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<summary>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>This module has two directives. The <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_actions">Action</directive> directive lets you run CGI
22d5d84393d960a2027f472036f3fee15d7dbce9nd scripts whenever a file of a certain type is requested. The
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive module="mod_actions">Script</directive> directive lets
22d5d84393d960a2027f472036f3fee15d7dbce9nd you run CGI scripts whenever a particular method is used in a
22d5d84393d960a2027f472036f3fee15d7dbce9nd request. This makes it much easier to execute scripts that process
22d5d84393d960a2027f472036f3fee15d7dbce9nd files.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</summary>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim<directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<name>Action</name>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<description>Activates a CGI script for a particular handler or
22d5d84393d960a2027f472036f3fee15d7dbce9ndcontent-type</description>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim
ecdc51f25765b81b6d07389c6fa02a9529411f5drbowen<syntax>Action <em>action-type cgi-script</em></syntax>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim<contextlist>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<context>server config</context><context>virtual host</context>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<context>directory</context><context>.htaccess</context>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</contextlist>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<override>FileInfo</override>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<usage>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>This directive adds an action, which will activate
22d5d84393d960a2027f472036f3fee15d7dbce9nd <em>cgi-script</em> when <em>action-type</em> is triggered by
22d5d84393d960a2027f472036f3fee15d7dbce9nd the request. The <em>action-type</em> can be either a <a
22d5d84393d960a2027f472036f3fee15d7dbce9nd href="/handler.html">handler</a> or a MIME content type. It
22d5d84393d960a2027f472036f3fee15d7dbce9nd sends the URL and file path of the requested document using the
22d5d84393d960a2027f472036f3fee15d7dbce9nd standard CGI PATH_INFO and PATH_TRANSLATED environment
22d5d84393d960a2027f472036f3fee15d7dbce9nd variables.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<title>Examples</title>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd # Requests for files of a particular type:<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Action image/gif /cgi-bin/images.cgi<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd # Files of a particular file extension<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd AddHandler my-file-type .xyz<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Action my-file-type /cgi-bin/program.cgi<br />
6a40b378ef57ef1dbc193c1afd600fa591d65ac9pctony</example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>In the first example, requests for files with a MIME content
22d5d84393d960a2027f472036f3fee15d7dbce9nd type of <code>image/gif</code> will instead be handled by the
22d5d84393d960a2027f472036f3fee15d7dbce9nd specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim
ac1a656380fb9c5636a1f41b7e284f8eb2d60011chrisd <p>In the second example, requests for files with a file extension of
22d5d84393d960a2027f472036f3fee15d7dbce9nd <code>.xyz</code> are handled instead by the specified cgi script
22d5d84393d960a2027f472036f3fee15d7dbce9nd <code>/cgi-bin/program.cgi</code>.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</usage>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<seealso><directive module="mod_mime">AddHandler</directive></seealso>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd</directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<name>Script</name>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<description>Activates a CGI script for a particular request
22d5d84393d960a2027f472036f3fee15d7dbce9ndmethod.</description>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<syntax> Script <em>method cgi-script</em></syntax>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<contextlist>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<context>server config</context><context>virtual host</context>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<context>directory</context></contextlist>
81c816b41dff7591b248d78309189055e0c9ebectakashi<usage>
81c816b41dff7591b248d78309189055e0c9ebectakashi <p>This directive adds an action, which will activate
22d5d84393d960a2027f472036f3fee15d7dbce9nd <em>cgi-script</em> when a file is requested using the method of
22d5d84393d960a2027f472036f3fee15d7dbce9nd <em>method</em>. It sends the URL and file path of the requested
22d5d84393d960a2027f472036f3fee15d7dbce9nd document using the standard CGI PATH_INFO and PATH_TRANSLATED
22d5d84393d960a2027f472036f3fee15d7dbce9nd environment variables.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<note>
22d5d84393d960a2027f472036f3fee15d7dbce9nd Any arbitrary method name may be used. <strong>Method names are
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper case-sensitive</strong>, so <code>Script&nbsp;PUT</code> and
22d5d84393d960a2027f472036f3fee15d7dbce9nd <code>Script&nbsp;put</code> have two entirely different
22d5d84393d960a2027f472036f3fee15d7dbce9nd effects.
22d5d84393d960a2027f472036f3fee15d7dbce9nd</note>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>Note that the Script command defines default actions only.
22d5d84393d960a2027f472036f3fee15d7dbce9nd If a CGI script is called, or some other resource that is
22d5d84393d960a2027f472036f3fee15d7dbce9nd capable of handling the requested method internally, it will do
22d5d84393d960a2027f472036f3fee15d7dbce9nd so. Also note that Script with a method of <code>GET</code>
22d5d84393d960a2027f472036f3fee15d7dbce9nd will only be called if there are query arguments present
22d5d84393d960a2027f472036f3fee15d7dbce9nd (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
22d5d84393d960a2027f472036f3fee15d7dbce9nd proceed normally.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd<example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<title>Examples</title>
22d5d84393d960a2027f472036f3fee15d7dbce9nd # For &lt;ISINDEX&gt;-style searching<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Script GET /cgi-bin/search<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd # A CGI PUT handler<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Script PUT /~bob/put.cgi<br />
a330659fa32865eb8521adaccf5d9b75687b9aebtrawick</example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</usage>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
22d5d84393d960a2027f472036f3fee15d7dbce9nd</directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd
a330659fa32865eb8521adaccf5d9b75687b9aebtrawick</modulesynopsis>