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<!--
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding the License. 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
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim<name>mod_actions</name>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
9e5acc39290b3341429131dfb126394871e9837drbowen<description>Execute CGI scripts based on media 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
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
c14037646789087319802aaada2e8534ccab0158slive files.</p> </summary>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
67a715b4352c3e25bff32fccad48350180393f5end<seealso><module>mod_cgi</module></seealso>
67a715b4352c3e25bff32fccad48350180393f5end<seealso><a href="/howto/cgi.html">Dynamic Content with CGI</a></seealso>
aa0c9ba3adef6e0e98c6f38d2bf690283b609aacrbowen<seealso><a href="/handler.html">Apache httpd'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>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive<usage>
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
217246fb83555fa4dfc1d791758a93ec4230f5bfslive module="mod_mime">AddHandler</directive>. The
67a715b4352c3e25bff32fccad48350180393f5end <var>action-type</var> can be either a <a
c14037646789087319802aaada2e8534ccab0158slive href="/handler.html">handler</a> or a <glossary
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>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
be43dfdc0292dc9ec54820ced4ebb82507e3bd76rbowen <example><title>Example: MIME type</title>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh <highlight language="config">
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh# Requests for files of a particular MIME content type:
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedoohAction image/gif /cgi-bin/images.cgi
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh </highlight>
67a715b4352c3e25bff32fccad48350180393f5end </example>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
be43dfdc0292dc9ec54820ced4ebb82507e3bd76rbowen <p>In this 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
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh <example>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh <title>Example: File extension</title>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh <highlight language="config">
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh# Files of a particular file extension
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedoohAddHandler my-file-type .xyz
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedoohAction my-file-type /cgi-bin/program.cgi
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh </highlight>
be43dfdc0292dc9ec54820ced4ebb82507e3bd76rbowen </example>
be43dfdc0292dc9ec54820ced4ebb82507e3bd76rbowen <p>In this example, requests for files with a file extension of
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <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
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh <highlight language="config">
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar&lt;Location "/news"&gt;
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh SetHandler news-handler
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh Action news-handler /cgi-bin/news.cgi virtual
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh&lt;/Location&gt;
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh </highlight>
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
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <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
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <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
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim 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
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh <highlight language="config">
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh# All GET requests go here
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedoohScript GET /cgi-bin/search
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh# A CGI PUT handler
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedoohScript PUT /~bob/put.cgi
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh </highlight>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</usage>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive</directivesynopsis>
1c47b0c72c991a6f0ad172c74df0936fe13d6fbfslive
4a70643d125a450bb3f611c1265e44607b140040gregames</modulesynopsis>