summaryrefslogtreecommitdiff
path: root/docs/manual/mod/mod_actions.html
blob: 47af987ae9968b0c7527fdfdd96d4f2ab37be349 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>Module mod_actions</TITLE>
</HEAD>

<BODY>
<!--#include virtual="header.html" -->
<H1>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, virtual 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, virtual 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>

<!--#include virtual="footer.html" -->
</BODY>
</HTML>