2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <modulesynopsis metafile="mod_actions.xml.meta">
6 <name>mod_actions</name>
8 <description>This module provides for executing CGI scripts based on
9 media type or request method.</description>
12 <sourcefile>mod_actions.c</sourcefile>
13 <identifier>actions_module</identifier>
16 <p>This module has two directives. The <directive
17 module="mod_actions">Action</directive> directive lets you run CGI
18 scripts whenever a file of a certain type is requested. The
19 <directive module="mod_actions">Script</directive> directive lets
20 you run CGI scripts whenever a particular method is used in a
21 request. This makes it much easier to execute scripts that process
25 <seealso><module>mod_cgi</module></seealso>
26 <seealso><a href="../howto/cgi.html">Dynamic Content with CGI</a></seealso>
27 <seealso><a href="../handler.html">Apache's Handler Use</a></seealso>
31 <description>Activates a CGI script for a particular handler or
32 content-type</description>
33 <syntax>Action <var>action-type</var> <var>cgi-script</var></syntax>
35 <context>server config</context><context>virtual host</context>
36 <context>directory</context><context>.htaccess</context>
38 <override>FileInfo</override>
41 <p>This directive adds an action, which will activate
42 <var>cgi-script</var> when <var>action-type</var> is triggered by the
43 request. The <var>cgi-script</var> is the URL-path to a resource
44 that has been designated as a CGI script using <directive
45 module="mod_alias">ScriptAlias</directive> or <directive
46 module="mod_mime">AddHandler</directive>. The
47 <var>action-type</var> can be either a <a
48 href="../handler.html">handler</a> or a MIME content type. It
49 sends the URL and file path of the requested document using the
50 standard CGI PATH_INFO and PATH_TRANSLATED environment
53 <example><title>Examples</title>
54 # Requests for files of a particular type:<br />
55 Action image/gif /cgi-bin/images.cgi<br />
57 # Files of a particular file extension<br />
58 AddHandler my-file-type .xyz<br />
59 Action my-file-type /cgi-bin/program.cgi<br />
62 <p>In the first example, requests for files with a MIME content
63 type of <code>image/gif</code> will instead be handled by the
64 specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
66 <p>In the second example, requests for files with a file extension of
67 <code>.xyz</code> are handled instead by the specified cgi script
68 <code>/cgi-bin/program.cgi</code>.</p>
71 <seealso><directive module="mod_mime">AddHandler</directive></seealso>
76 <description>Activates a CGI script for a particular request
78 <syntax>Script <var>method</var> <var>cgi-script</var></syntax>
80 <context>server config</context><context>virtual host</context>
81 <context>directory</context></contextlist>
83 <p>This directive adds an action, which will activate
84 <var>cgi-script</var> when a file is requested using the method of
85 <var>method</var>. The <var>cgi-script</var> is the URL-path to a
86 resource that has been designated as a CGI script using <directive
87 module="mod_alias">ScriptAlias</directive> or <directive
88 module="mod_mime">AddHandler</directive>. The URL and
89 file path of the requested document is sent using the standard CGI
90 PATH_INFO and PATH_TRANSLATED environment variables.</p>
93 Any arbitrary method name may be used. <strong>Method names are
94 case-sensitive</strong>, so <code>Script PUT</code> and
95 <code>Script put</code> have two entirely different
99 <p>Note that the Script command defines default actions only.
100 If a CGI script is called, or some other resource that is
101 capable of handling the requested method internally, it will do
102 so. Also note that Script with a method of <code>GET</code>
103 will only be called if there are query arguments present
104 (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
105 proceed normally.</p>
107 <example><title>Examples</title>
108 # For <ISINDEX>-style searching<br />
109 Script GET /cgi-bin/search<br />
111 # A CGI PUT handler<br />
112 Script PUT /~bob/put.cgi<br />