]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_actions.xml
add the metafile attribute to all xml files.
[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 metafile="mod_actions.xml.meta">
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 <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>
28
29 <directivesynopsis>
30 <name>Action</name>
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>
34 <contextlist>
35 <context>server config</context><context>virtual host</context>
36 <context>directory</context><context>.htaccess</context>
37 </contextlist>
38 <override>FileInfo</override>
39
40 <usage>
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
51     variables.</p>
52
53     <example><title>Examples</title>
54       # Requests for files of a particular type:<br />
55       Action image/gif /cgi-bin/images.cgi<br />
56       <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 />
60     </example>
61
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>
65
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>
69 </usage>
70
71 <seealso><directive module="mod_mime">AddHandler</directive></seealso>
72 </directivesynopsis>
73
74 <directivesynopsis>
75 <name>Script</name>
76 <description>Activates a CGI script for a particular request
77 method.</description>
78 <syntax>Script <var>method</var> <var>cgi-script</var></syntax>
79 <contextlist>
80 <context>server config</context><context>virtual host</context>
81 <context>directory</context></contextlist>
82 <usage>
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>
91
92     <note>
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
96       effects.
97     </note>
98
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>
106
107     <example><title>Examples</title>
108       # For &lt;ISINDEX&gt;-style searching<br />
109       Script GET /cgi-bin/search<br />
110       <br />
111       # A CGI PUT handler<br />
112       Script PUT /~bob/put.cgi<br />
113     </example>
114 </usage>
115 </directivesynopsis>
116
117 </modulesynopsis>