mod_actions.xml revision 6fbd2e53c97ea6976d93e0ac521adabc55e0fb73
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<?xml version="1.0"?>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<!--
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Copyright 2002-2004 The Apache Software Foundation
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed under the Apache License, Version 2.0 (the "License");
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding you may not use this file except in compliance with the License.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding You may obtain a copy of the License at
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding http://www.apache.org/licenses/LICENSE-2.0
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd-->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<modulesynopsis metafile="mod_actions.xml.meta">
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
7db9f691a00ead175b03335457ca296a33ddf31bnd<name>mod_actions</name>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<description>This module provides for executing CGI scripts based on
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantzmedia type or request method.</description>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<status>Base</status>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<sourcefile>mod_actions.c</sourcefile>
169280c7e65362d4ed444ec262c3f22a6a280166nd<identifier>actions_module</identifier>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<summary>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <p>This module has two directives. The <directive
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz module="mod_actions">Action</directive> directive lets you run CGI
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz scripts whenever a file of a certain MIME content type is requested. The
3604deb3632beeca54cfdb3864d872715971c300slive <directive module="mod_actions">Script</directive> directive lets
3604deb3632beeca54cfdb3864d872715971c300slive you run CGI scripts whenever a particular method is used in a
3604deb3632beeca54cfdb3864d872715971c300slive request. This makes it much easier to execute scripts that process
3604deb3632beeca54cfdb3864d872715971c300slive files.</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz</summary>
87a0e78ba862eb998ccd545ae27c46c7ef89215abnicholes
87a0e78ba862eb998ccd545ae27c46c7ef89215abnicholes<seealso><module>mod_cgi</module></seealso>
87a0e78ba862eb998ccd545ae27c46c7ef89215abnicholes<seealso><a href="/howto/cgi.html">Dynamic Content with CGI</a></seealso>
ac1a656380fb9c5636a1f41b7e284f8eb2d60011chrisd<seealso><a href="/handler.html">Apache's Handler Use</a></seealso>
92988aaf68a67c9fa417556cb944eba6bb82ef92rbowen
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<directivesynopsis>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<name>Action</name>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<description>Activates a CGI script for a particular handler or
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantzcontent-type</description>
3604deb3632beeca54cfdb3864d872715971c300slive<syntax>Action <var>action-type</var> <var>cgi-script</var> [virtual]</syntax>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd<contextlist>
3604deb3632beeca54cfdb3864d872715971c300slive<context>server config</context><context>virtual host</context>
f07998c217193b829f55c5ca8f4313ad5ba28f84nd<context>directory</context><context>.htaccess</context>
f07998c217193b829f55c5ca8f4313ad5ba28f84nd</contextlist>
f07998c217193b829f55c5ca8f4313ad5ba28f84nd<override>FileInfo</override>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<compatibility>The <code>virtual</code> modifier and handler passing were
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantzintroduced in Apache 2.1</compatibility>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd<usage>
3604deb3632beeca54cfdb3864d872715971c300slive <p>This directive adds an action, which will activate
3604deb3632beeca54cfdb3864d872715971c300slive <var>cgi-script</var> when <var>action-type</var> is triggered by the
3604deb3632beeca54cfdb3864d872715971c300slive request. The <var>cgi-script</var> is the URL-path to a resource
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd that has been designated as a CGI script using <directive
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd module="mod_alias">ScriptAlias</directive> or <directive
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd module="mod_mime">AddHandler</directive>. The
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd <var>action-type</var> can be either a <a
3604deb3632beeca54cfdb3864d872715971c300slive href="/handler.html">handler</a> or a MIME content type. It
a5bff87eecd8413fcbee33eae01db42945b76becrbowen sends the URL and file path of the requested document using the
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd standard CGI <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd environment variables. The handler used for the particular request is
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd passed using the <code>REDIRECT_HANDLER</code> variable.</p>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd <example><title>Examples</title>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd # Requests for files of a particular MIME content type:<br />
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd Action image/gif /cgi-bin/images.cgi<br />
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <br />
3604deb3632beeca54cfdb3864d872715971c300slive # Files of a particular file extension<br />
3604deb3632beeca54cfdb3864d872715971c300slive AddHandler my-file-type .xyz<br />
3604deb3632beeca54cfdb3864d872715971c300slive Action my-file-type /cgi-bin/program.cgi<br />
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz </example>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <p>In the first example, requests for files with a MIME content
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz type of <code>image/gif</code> will be handled by the
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd <p>In the second example, requests for files with a file extension of
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd <code>.xyz</code> are handled by the specified cgi script
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd <code>/cgi-bin/program.cgi</code>.</p>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <p>The optional <code>virtual</code> modifier turns off the check
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz whether the requested file really exists. This is useful, for example,
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz if you want to use the <directive>Action</directive> directive in
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz virtual locations.</p>
3604deb3632beeca54cfdb3864d872715971c300slive
3604deb3632beeca54cfdb3864d872715971c300slive <example><title>Example</title>
3604deb3632beeca54cfdb3864d872715971c300slive &lt;Location /news&gt;<br />
3604deb3632beeca54cfdb3864d872715971c300slive <indent>
3604deb3632beeca54cfdb3864d872715971c300slive SetHandler news-handler<br />
3604deb3632beeca54cfdb3864d872715971c300slive Action news-handler /cgi-bin/news.cgi virtual<br />
3604deb3632beeca54cfdb3864d872715971c300slive </indent>
3604deb3632beeca54cfdb3864d872715971c300slive &lt;/Location&gt;
3604deb3632beeca54cfdb3864d872715971c300slive </example>
3604deb3632beeca54cfdb3864d872715971c300slive</usage>
3604deb3632beeca54cfdb3864d872715971c300slive
3604deb3632beeca54cfdb3864d872715971c300slive<seealso><directive module="mod_mime">AddHandler</directive></seealso>
3604deb3632beeca54cfdb3864d872715971c300slive</directivesynopsis>
3604deb3632beeca54cfdb3864d872715971c300slive
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<directivesynopsis>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<name>Script</name>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<description>Activates a CGI script for a particular request
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantzmethod.</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
<code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> 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 <directive>Script</directive> 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 <directive>Script</directive> 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>