mod_actions.xml revision 5f5d1b4cc970b7f06ff8ef6526128e9a27303d88
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<?xml version="1.0"?>
d24d4c5159bcb11c25bb294926cfe7105c789ea9slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<!--
6fbd2e53c97ea6976d93e0ac521adabc55e0fb73nd Copyright 2002-2004 The Apache Software Foundation
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Licensed under the Apache License, Version 2.0 (the "License");
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd you may not use this file except in compliance with the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd 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
7db9f691a00ead175b03335457ca296a33ddf31bnd<modulesynopsis metafile="mod_actions.xml.meta">
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<name>mod_actions</name>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<description>This module provides for executing CGI scripts based on
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslivemedia type or request method.</description>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<status>Base</status>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<sourcefile>mod_actions.c</sourcefile>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<identifier>actions_module</identifier>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<summary>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive <p>This module has two directives. The <directive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive module="mod_actions">Action</directive> directive lets you run CGI
8529679ec1c2e3285d9a2b0e124d3af16154c406kess scripts whenever a file of a certain MIME content type is requested. The
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive <directive module="mod_actions">Script</directive> directive lets
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive you run CGI scripts whenever a particular method is used in a
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive request. This makes it much easier to execute scripts that process
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive files.</p>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</summary>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
67a715b4352c3e25bff32fccad48350180393f5end<seealso><module>mod_cgi</module></seealso>
67a715b4352c3e25bff32fccad48350180393f5end<seealso><a href="/howto/cgi.html">Dynamic Content with CGI</a></seealso>
67a715b4352c3e25bff32fccad48350180393f5end<seealso><a href="/handler.html">Apache's Handler Use</a></seealso>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
67a715b4352c3e25bff32fccad48350180393f5end<directivesynopsis>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<name>Action</name>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<description>Activates a CGI script for a particular handler or
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslivecontent-type</description>
a4031657b4020b74639885763e58576400c65c3dnd<syntax>Action <var>action-type</var> <var>cgi-script</var> [virtual]</syntax>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<contextlist>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<context>server config</context><context>virtual host</context>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<context>directory</context><context>.htaccess</context>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</contextlist>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<override>FileInfo</override>
e19681198636b7d979c040d08e0288935a2faf53nd<compatibility>The <code>virtual</code> modifier and handler passing were
e19681198636b7d979c040d08e0288935a2faf53ndintroduced in Apache 2.1</compatibility>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<usage>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive <p>This directive adds an action, which will activate
67a715b4352c3e25bff32fccad48350180393f5end <var>cgi-script</var> when <var>action-type</var> is triggered by the
67a715b4352c3e25bff32fccad48350180393f5end request. The <var>cgi-script</var> is the URL-path to a resource
217246fb83555fa4dfc1d791758a93ec4230f5bfslive that has been designated as a CGI script using <directive
4a70643d125a450bb3f611c1265e44607b140040gregames module="mod_alias">ScriptAlias</directive> or <directive
217246fb83555fa4dfc1d791758a93ec4230f5bfslive module="mod_mime">AddHandler</directive>. The
67a715b4352c3e25bff32fccad48350180393f5end <var>action-type</var> can be either a <a
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive href="/handler.html">handler</a> or a MIME content type. It
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive sends the URL and file path of the requested document using the
e19681198636b7d979c040d08e0288935a2faf53nd standard CGI <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code>
e19681198636b7d979c040d08e0288935a2faf53nd environment variables. The handler used for the particular request is
e19681198636b7d979c040d08e0288935a2faf53nd passed using the <code>REDIRECT_HANDLER</code> variable.</p>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
67a715b4352c3e25bff32fccad48350180393f5end <example><title>Examples</title>
8529679ec1c2e3285d9a2b0e124d3af16154c406kess # Requests for files of a particular MIME content type:<br />
67a715b4352c3e25bff32fccad48350180393f5end Action image/gif /cgi-bin/images.cgi<br />
67a715b4352c3e25bff32fccad48350180393f5end <br />
67a715b4352c3e25bff32fccad48350180393f5end # Files of a particular file extension<br />
67a715b4352c3e25bff32fccad48350180393f5end AddHandler my-file-type .xyz<br />
67a715b4352c3e25bff32fccad48350180393f5end Action my-file-type /cgi-bin/program.cgi<br />
67a715b4352c3e25bff32fccad48350180393f5end </example>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive <p>In the first example, requests for files with a MIME content
725ecc2b5c7499ee392e85a151778718a8e33dcckess type of <code>image/gif</code> will be handled by the
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive <p>In the second example, requests for files with a file extension of
725ecc2b5c7499ee392e85a151778718a8e33dcckess <code>.xyz</code> are handled by the specified cgi script
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive <code>/cgi-bin/program.cgi</code>.</p>
a4031657b4020b74639885763e58576400c65c3dnd
a4031657b4020b74639885763e58576400c65c3dnd <p>The optional <code>virtual</code> modifier turns off the check
a4031657b4020b74639885763e58576400c65c3dnd whether the requested file really exists. This is useful, for example,
a4031657b4020b74639885763e58576400c65c3dnd if you want to use the <directive>Action</directive> directive in
a4031657b4020b74639885763e58576400c65c3dnd virtual locations.</p>
a4031657b4020b74639885763e58576400c65c3dnd
a4031657b4020b74639885763e58576400c65c3dnd <example><title>Example</title>
a4031657b4020b74639885763e58576400c65c3dnd &lt;Location /news&gt;<br />
a4031657b4020b74639885763e58576400c65c3dnd <indent>
bb709287f5444b1ab64b96f815b965b261583ce5nd SetHandler news-handler<br />
bb709287f5444b1ab64b96f815b965b261583ce5nd Action news-handler /cgi-bin/news.cgi virtual<br />
a4031657b4020b74639885763e58576400c65c3dnd </indent>
a4031657b4020b74639885763e58576400c65c3dnd &lt;/Location&gt;
a4031657b4020b74639885763e58576400c65c3dnd </example>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</usage>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<seealso><directive module="mod_mime">AddHandler</directive></seealso>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</directivesynopsis>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<directivesynopsis>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<name>Script</name>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<description>Activates a CGI script for a particular request
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslivemethod.</description>
f80e267f416eda70d74550e77b11bdc42ecd104dnd<syntax>Script <var>method</var> <var>cgi-script</var></syntax>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<contextlist>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<context>server config</context><context>virtual host</context>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<context>directory</context></contextlist>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<usage>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive <p>This directive adds an action, which will activate
67a715b4352c3e25bff32fccad48350180393f5end <var>cgi-script</var> when a file is requested using the method of
67a715b4352c3e25bff32fccad48350180393f5end <var>method</var>. The <var>cgi-script</var> is the URL-path to a
217246fb83555fa4dfc1d791758a93ec4230f5bfslive resource that has been designated as a CGI script using <directive
529258d4aa14c83ac8ef5392731cb58ac0068495nd module="mod_alias">ScriptAlias</directive> or <directive
217246fb83555fa4dfc1d791758a93ec4230f5bfslive module="mod_mime">AddHandler</directive>. The URL and
217246fb83555fa4dfc1d791758a93ec4230f5bfslive file path of the requested document is sent using the standard CGI
725ecc2b5c7499ee392e85a151778718a8e33dcckess <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> environment
725ecc2b5c7499ee392e85a151778718a8e33dcckess variables.</p>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
67a715b4352c3e25bff32fccad48350180393f5end <note>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive Any arbitrary method name may be used. <strong>Method names are
67a715b4352c3e25bff32fccad48350180393f5end case-sensitive</strong>, so <code>Script PUT</code> and
67a715b4352c3e25bff32fccad48350180393f5end <code>Script put</code> have two entirely different
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive effects.
67a715b4352c3e25bff32fccad48350180393f5end </note>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
725ecc2b5c7499ee392e85a151778718a8e33dcckess <p>Note that the <directive>Script</directive> command defines default
725ecc2b5c7499ee392e85a151778718a8e33dcckess actions only. If a CGI script is called, or some other resource that is
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive capable of handling the requested method internally, it will do
725ecc2b5c7499ee392e85a151778718a8e33dcckess so. Also note that <directive>Script</directive> with a method of
725ecc2b5c7499ee392e85a151778718a8e33dcckess <code>GET</code> will only be called if there are query arguments present
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive proceed normally.</p>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
67a715b4352c3e25bff32fccad48350180393f5end <example><title>Examples</title>
67a715b4352c3e25bff32fccad48350180393f5end # For &lt;ISINDEX&gt;-style searching<br />
67a715b4352c3e25bff32fccad48350180393f5end Script GET /cgi-bin/search<br />
67a715b4352c3e25bff32fccad48350180393f5end <br />
67a715b4352c3e25bff32fccad48350180393f5end # A CGI PUT handler<br />
67a715b4352c3e25bff32fccad48350180393f5end Script PUT /~bob/put.cgi<br />
67a715b4352c3e25bff32fccad48350180393f5end </example>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</usage>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</directivesynopsis>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
4a70643d125a450bb3f611c1265e44607b140040gregames</modulesynopsis>