blob: 297df17ba86c6902fdb2e107ff1c69081811353e [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>Apache module mod_actions</TITLE>
</HEAD>
<BODY>
<IMG SRC="../images/apache_sub.gif" ALT="">
<H1>Apache module mod_actions</h1>
This module is contained in the <code>mod_actions.c</code> file, and
is compiled in by default. It provides for
executing CGI scripts based on media type or request method. It is not
present in versions prior to Apache 1.1.
<h2>Summary</h2>
This module lets you run CGI scripts whenever a file of a certain type
is requested. This makes it much easier to execute scripts that
process files.
<h2>Directives</h2>
<ul>
<li><A HREF="#action">Action</A>
<li><A HREF="#script">Script</A>
</ul>
<hr>
<A name="action"><h2>Action</h2></A>
<strong>Syntax:</strong> Action <em>mime-type cgi-script</em><br>
<strong>Context:</strong> server config, virutal host, directory, .htaccess<br>
<strong>Override:</strong> FileInfo<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_actions<br>
<strong>Compatibility:</strong> Action is only available in Apache 1.1
and later<p>
This directive adds an action, which will activate <em>cgi-script</em> when
a file of content type <em>mime-type</em> is requested. It sends the
URL and file path of the requested document using the standard
CGI PATH_INFO and PATH_TRANSLATED environment variables.
<hr>
<A name="script"><h2>Script</h2></A>
<strong>Syntax:</strong> Script <em>method cgi-script</em><br>
<strong>Context:</strong> server config, virutal host, directory<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_actions<br>
<strong>Compatibility:</strong> Script is only available in Apache 1.1
and later<p>
<p>This directive adds an action, which will activate <em>cgi-script</em> when
a file is requested using the method of <em>method</em>, which can be
one of <code>GET</code>, <code>POST</code>, <code>PUT</code> or
<code>DELETE</code>. It sends the
URL and file path of the requested document using the standard
CGI PATH_INFO and PATH_TRANSLATED environment variables.
<p>Note that the Script command defines default actions only. If a CGI
script is called, or some other resource that is capable of handling
the requested method internally, it will do so. Also note that script
with a method of <code>GET</code> will only be called if there are
query arguments present (e.g. foo.html?hi). Otherwise, the request
will proceed normally.
<p>Examples:
<pre>
Script GET /cgi-bin/search #e.g. for &lt;ISINDEX&gt;-style searching
Script PUT /~bob/put.cgi
</pre>
<p><hr>
<A HREF="../"><IMG SRC="../images/apache_home.gif" ALT="Home"></A>
<A HREF="./"><IMG SRC="../images/apache_index.gif" ALT="Index"></A>
</BODY>
</HTML>