mod_actions.xml revision 6f10385908fbdfd4849e4bc50e690ee54c62f2cd
530eba85dbd41b8a0fa5255d3648d1440199a661slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
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 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.
530eba85dbd41b8a0fa5255d3648d1440199a661slive<description>This module provides for executing CGI scripts based on
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivemedia type or request method.</description>
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<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>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
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<compatibility>The <code>virtual</code> modifier and handler passing were
fb77c505254b6e9c925e23e734463e87574f8f40kessintroduced in Apache 2.1</compatibility>
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
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# Requests for files of a particular MIME content type:
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </highlight>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>In this example, requests for files with a MIME content
fb77c505254b6e9c925e23e734463e87574f8f40kess specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd# Files of a particular file extension
130d299c4b2b15be45532a176604c71fdc7bea5bndAddHandler my-file-type .xyz
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
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>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<Location /news>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive SetHandler news-handler
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</Location>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </highlight>
003f0c9fda6664daf5092a0e42f65ede20098153slive<seealso><directive module="mod_mime">AddHandler</directive></seealso>
003f0c9fda6664daf5092a0e42f65ede20098153slive</directivesynopsis>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<directivesynopsis>
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 <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 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>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Any arbitrary method name may be used. <strong>Method names are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive case-sensitive</strong>, so <code>Script PUT</code> and
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# All GET requests go here
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding# A CGI PUT handler
684f2a9a422185adda0692a1203c5ad6687fc5c5nd </highlight>
684f2a9a422185adda0692a1203c5ad6687fc5c5nd</directivesynopsis>
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding</modulesynopsis>