mod_actions.xml revision 6f10385908fbdfd4849e4bc50e690ee54c62f2cd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<?xml version="1.0"?>
530eba85dbd41b8a0fa5255d3648d1440199a661slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<!--
6fbd2e53c97ea6976d93e0ac521adabc55e0fb73nd Licensed to the Apache Software Foundation (ASF) under one or more
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd contributor license agreements. See the NOTICE file distributed with
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd this work for additional information regarding copyright ownership.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd The ASF licenses this file to You under the Apache License, Version 2.0
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd (the "License"); you may not use this file except in compliance with
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd 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-->
7db9f691a00ead175b03335457ca296a33ddf31bnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<modulesynopsis metafile="mod_actions.xml.meta">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<name>mod_actions</name>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
530eba85dbd41b8a0fa5255d3648d1440199a661slive<description>This module provides for executing CGI scripts based on
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivemedia type or request method.</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<status>Base</status>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<sourcefile>mod_actions.c</sourcefile>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<identifier>actions_module</identifier>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<summary>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This module has two directives. The <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="mod_actions">Action</directive> directive lets you run CGI
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele scripts whenever a file of a certain <glossary
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ref="mime-type">MIME content type</glossary> is requested. The
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="mod_actions">Script</directive> directive lets
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive you run CGI scripts whenever a particular method is used in a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request. This makes it much easier to execute scripts that process
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive files.</p> </summary>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><module>mod_cgi</module></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/howto/cgi.html">Dynamic Content with CGI</a></seealso>
fb77c505254b6e9c925e23e734463e87574f8f40kess<seealso><a href="/handler.html">Apache httpd's Handler Use</a></seealso>
fb77c505254b6e9c925e23e734463e87574f8f40kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<name>Action</name>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Activates a CGI script for a particular handler or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivecontent-type</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<syntax>Action <var>action-type</var> <var>cgi-script</var> [virtual]</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist>
fb77c505254b6e9c925e23e734463e87574f8f40kess<context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<override>FileInfo</override>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<compatibility>The <code>virtual</code> modifier and handler passing were
fb77c505254b6e9c925e23e734463e87574f8f40kessintroduced in Apache 2.1</compatibility>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<usage>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive adds an action, which will activate
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <var>cgi-script</var> when <var>action-type</var> is triggered by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the request. The <var>cgi-script</var> is the URL-path to a
fb77c505254b6e9c925e23e734463e87574f8f40kess resource that has been designated as a CGI script using <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="mod_alias">ScriptAlias</directive> or <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="mod_mime">AddHandler</directive>. The
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <var>action-type</var> can be either a <a
fb77c505254b6e9c925e23e734463e87574f8f40kess href="/handler.html">handler</a> or a <glossary
fb77c505254b6e9c925e23e734463e87574f8f40kess ref="mime-type">MIME content type</glossary>. It sends the URL and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive file path of the requested document using the standard CGI
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code>
fb77c505254b6e9c925e23e734463e87574f8f40kess environment variables. The handler used for the particular request
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess is passed using the <code>REDIRECT_HANDLER</code> variable.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb77c505254b6e9c925e23e734463e87574f8f40kess <example><title>Example: MIME type</title>
fb77c505254b6e9c925e23e734463e87574f8f40kess <highlight language="config">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive# Requests for files of a particular MIME content type:
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveAction image/gif /cgi-bin/images.cgi
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </highlight>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </example>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>In this example, requests for files with a MIME content
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type of <code>image/gif</code> will be handled by the
fb77c505254b6e9c925e23e734463e87574f8f40kess specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <example>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <title>Example: File extension</title>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <highlight language="config">
130d299c4b2b15be45532a176604c71fdc7bea5bnd# Files of a particular file extension
130d299c4b2b15be45532a176604c71fdc7bea5bndAddHandler my-file-type .xyz
130d299c4b2b15be45532a176604c71fdc7bea5bndAction my-file-type /cgi-bin/program.cgi
130d299c4b2b15be45532a176604c71fdc7bea5bnd </highlight>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess </example>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>In this example, requests for files with a file extension of
130d299c4b2b15be45532a176604c71fdc7bea5bnd <code>.xyz</code> are handled by the specified cgi script
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>/cgi-bin/program.cgi</code>.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The optional <code>virtual</code> modifier turns off the check
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive whether the requested file really exists. This is useful, for example,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive if you want to use the <directive>Action</directive> directive in
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive virtual locations.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
003f0c9fda6664daf5092a0e42f65ede20098153slive <highlight language="config">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd&lt;Location /news&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive SetHandler news-handler
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Action news-handler /cgi-bin/news.cgi virtual
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive&lt;/Location&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </highlight>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</usage>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
003f0c9fda6664daf5092a0e42f65ede20098153slive<seealso><directive module="mod_mime">AddHandler</directive></seealso>
003f0c9fda6664daf5092a0e42f65ede20098153slive</directivesynopsis>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<name>Script</name>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<description>Activates a CGI script for a particular request
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cndmethod.</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>Script <var>method</var> <var>cgi-script</var></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<usage>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive adds an action, which will activate
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <var>cgi-script</var> when a file is requested using the method of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <var>method</var>. The <var>cgi-script</var> is the URL-path to a
130d299c4b2b15be45532a176604c71fdc7bea5bnd resource that has been designated as a CGI script using <directive
130d299c4b2b15be45532a176604c71fdc7bea5bnd module="mod_alias">ScriptAlias</directive> or <directive
130d299c4b2b15be45532a176604c71fdc7bea5bnd module="mod_mime">AddHandler</directive>. The URL and
130d299c4b2b15be45532a176604c71fdc7bea5bnd file path of the requested document is sent using the standard CGI
130d299c4b2b15be45532a176604c71fdc7bea5bnd <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> environment
130d299c4b2b15be45532a176604c71fdc7bea5bnd variables.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <note>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Any arbitrary method name may be used. <strong>Method names are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive case-sensitive</strong>, so <code>Script PUT</code> and
1a3f62ca37273a15a06bb94a61d3c6fcf4bf38c9rbowen <code>Script put</code> have two entirely different
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive effects.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </note>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Note that the <directive>Script</directive> command defines default
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding actions only. If a CGI script is called, or some other resource that is
684f2a9a422185adda0692a1203c5ad6687fc5c5nd capable of handling the requested method internally, it will do
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd so. Also note that <directive>Script</directive> with a method of
530eba85dbd41b8a0fa5255d3648d1440199a661slive <code>GET</code> will only be called if there are query arguments present
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive proceed normally.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
003f0c9fda6664daf5092a0e42f65ede20098153slive <highlight language="config">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive# All GET requests go here
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveScript GET /cgi-bin/search
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding# A CGI PUT handler
843a03fe0b138a4c1f64cb90a014e9417ac30691fieldingScript PUT /~bob/put.cgi
684f2a9a422185adda0692a1203c5ad6687fc5c5nd </highlight>
684f2a9a422185adda0692a1203c5ad6687fc5c5nd</usage>
684f2a9a422185adda0692a1203c5ad6687fc5c5nd</directivesynopsis>
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding</modulesynopsis>
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding