mod_actions.xml revision c14037646789087319802aaada2e8534ccab0158
d24d4c5159bcb11c25bb294926cfe7105c789ea9slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
08cb74ca432a8c24e39f17dedce527e6a47b8001jerenkrantz Copyright 2002-2005 The Apache Software Foundation or its licensors, as
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 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.
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<description>This module provides for executing CGI scripts based on
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslivemedia type or request method.</description>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive module="mod_actions">Action</directive> directive lets you run CGI
c14037646789087319802aaada2e8534ccab0158slive scripts whenever a file of a certain <glossary
c14037646789087319802aaada2e8534ccab0158slive ref="mime-type">MIME content type</glossary> 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
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>
67a715b4352c3e25bff32fccad48350180393f5end<directivesynopsis>
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>
e19681198636b7d979c040d08e0288935a2faf53nd<compatibility>The <code>virtual</code> modifier and handler passing were
e19681198636b7d979c040d08e0288935a2faf53ndintroduced in Apache 2.1</compatibility>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive <p>This directive adds an action, which will activate
c14037646789087319802aaada2e8534ccab0158slive <var>cgi-script</var> when <var>action-type</var> is triggered by
c14037646789087319802aaada2e8534ccab0158slive the request. The <var>cgi-script</var> is the URL-path to a
c14037646789087319802aaada2e8534ccab0158slive resource that has been designated as a CGI script using <directive
4a70643d125a450bb3f611c1265e44607b140040gregames module="mod_alias">ScriptAlias</directive> or <directive
c14037646789087319802aaada2e8534ccab0158slive ref="mime-type">MIME content type</glossary>. It sends the URL and
c14037646789087319802aaada2e8534ccab0158slive file path of the requested document using the standard CGI
c14037646789087319802aaada2e8534ccab0158slive <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code>
c14037646789087319802aaada2e8534ccab0158slive environment variables. The handler used for the particular request
c14037646789087319802aaada2e8534ccab0158slive is passed using the <code>REDIRECT_HANDLER</code> variable.</p>
8529679ec1c2e3285d9a2b0e124d3af16154c406kess # Requests for files of a particular MIME content type:<br />
67a715b4352c3e25bff32fccad48350180393f5end # Files of a particular file extension<br />
67a715b4352c3e25bff32fccad48350180393f5end AddHandler my-file-type .xyz<br />
67a715b4352c3e25bff32fccad48350180393f5end </example>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive <p>In the first example, requests for files with a MIME content
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
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
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 <Location /news><br />
bb709287f5444b1ab64b96f815b965b261583ce5nd SetHandler news-handler<br />
a4031657b4020b74639885763e58576400c65c3dnd </Location>
a4031657b4020b74639885763e58576400c65c3dnd </example>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<seealso><directive module="mod_mime">AddHandler</directive></seealso>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</directivesynopsis>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<directivesynopsis>
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 <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
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 Any arbitrary method name may be used. <strong>Method names are
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>
67a715b4352c3e25bff32fccad48350180393f5end # For <ISINDEX>-style searching<br />
67a715b4352c3e25bff32fccad48350180393f5end # A CGI PUT handler<br />
67a715b4352c3e25bff32fccad48350180393f5end </example>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</directivesynopsis>
4a70643d125a450bb3f611c1265e44607b140040gregames</modulesynopsis>