]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_actions.xml
Update the stylesheet reference to the new language-specific version.
[apache] / docs / manual / mod / mod_actions.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <modulesynopsis>
5
6 <name>mod_actions</name> 
7
8 <description>This module provides for executing CGI scripts based on
9 media type or request method.</description>
10
11 <status>Base</status>
12 <sourcefile>mod_actions.c</sourcefile>
13 <identifier>actions_module</identifier>
14
15 <summary>
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
22     files.</p>
23 </summary>
24
25 <directivesynopsis>
26
27 <name>Action</name>
28
29 <description>Activates a CGI script for a particular handler or
30 content-type</description>
31
32 <syntax>Action <em>action-type cgi-script</em></syntax>
33 <contextlist>
34 <context>server config</context><context>virtual host</context>
35 <context>directory</context><context>.htaccess</context>
36 </contextlist>
37 <override>FileInfo</override>
38
39 <usage>
40     <p>This directive adds an action, which will activate
41     <em>cgi-script</em> when <em>action-type</em> is triggered by the
42     request.  The <em>cgi-script</em> is the URL-path to a resource
43     that has been designated as a CGI script using <directive
44     module="mod_alias">ScriptAliase</directive> or <directive
45     module="mod_mime">AddHandler</directive>.  The
46     <em>action-type</em> can be either a <a
47     href="../handler.html">handler</a> or a MIME content type. It
48     sends the URL and file path of the requested document using the
49     standard CGI PATH_INFO and PATH_TRANSLATED environment
50     variables.</p>
51
52 <example>
53 <title>Examples</title>
54
55     # Requests for files of a particular type:<br />
56     Action image/gif /cgi-bin/images.cgi<br />
57 <br />
58     # Files of a particular file extension<br />
59     AddHandler my-file-type .xyz<br />
60     Action my-file-type /cgi-bin/program.cgi<br />
61 </example>
62
63     <p>In the first example, requests for files with a MIME content
64     type of <code>image/gif</code> will instead be handled by the
65     specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
66
67     <p>In the second example, requests for files with a file extension of
68     <code>.xyz</code> are handled instead by the specified cgi script 
69     <code>/cgi-bin/program.cgi</code>.</p>
70 </usage>
71
72 <seealso><directive module="mod_mime">AddHandler</directive></seealso>
73
74 </directivesynopsis>
75
76 <directivesynopsis>
77
78 <name>Script</name>
79
80 <description>Activates a CGI script for a particular request
81 method.</description>
82 <syntax> Script <em>method cgi-script</em></syntax>
83 <contextlist>
84 <context>server config</context><context>virtual host</context>
85 <context>directory</context></contextlist>
86 <usage>
87     <p>This directive adds an action, which will activate
88     <em>cgi-script</em> when a file is requested using the method of
89     <em>method</em>. The <em>cgi-script</em> is the URL-path to a
90     resource that has been designated as a CGI script using <directive
91     module="mod_alias">ScriptAliase</directive> or <directive
92     module="mod_mime">AddHandler</directive>.  The URL and
93     file path of the requested document is sent using the standard CGI
94     PATH_INFO and PATH_TRANSLATED environment variables.</p>
95
96 <note>
97       Any arbitrary method name may be used. <strong>Method names are
98       case-sensitive</strong>, so <code>Script&nbsp;PUT</code> and
99       <code>Script&nbsp;put</code> have two entirely different
100       effects.
101 </note>
102
103     <p>Note that the Script command defines default actions only.
104     If a CGI script is called, or some other resource that is
105     capable of handling the requested method internally, it will do
106     so. Also note that Script with a method of <code>GET</code>
107     will only be called if there are query arguments present
108     (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
109     proceed normally.</p>
110
111 <example>
112 <title>Examples</title>
113     # For &lt;ISINDEX&gt;-style searching<br />
114     Script GET /cgi-bin/search<br />
115     # A CGI PUT handler<br />
116     Script PUT /~bob/put.cgi<br />
117 </example>
118 </usage>
119
120 </directivesynopsis>
121
122 </modulesynopsis>