]> granicus.if.org Git - apache/blobdiff - docs/manual/mod/mod_actions.xml
Merge in APR[-util] macros from branches/trunk-buildconf-noapr
[apache] / docs / manual / mod / mod_actions.xml
index f14da5c79995bc438ee30bb9b475f029c428b280..d9a9457ca39d85b3ef454d573d88619d65cd8174 100644 (file)
@@ -1,13 +1,15 @@
 <?xml version="1.0"?>
 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
+<!-- $LastChangedRevision$ -->
 
 <!--
- Copyright 2002-2004 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
 
      http://www.apache.org/licenses/LICENSE-2.0
 
 
 <modulesynopsis metafile="mod_actions.xml.meta">
 
-<name>mod_actions</name> 
+<name>mod_actions</name>
 
-<description>This module provides for executing CGI scripts based on
-media type or request method.</description>
+<description>Execute CGI scripts based on media type or request method.</description>
 
 <status>Base</status>
 <sourcefile>mod_actions.c</sourcefile>
@@ -32,16 +33,16 @@ media type or request method.</description>
 <summary>
     <p>This module has two directives. The <directive
     module="mod_actions">Action</directive> directive lets you run CGI
-    scripts whenever a file of a certain MIME content type is requested. The
+    scripts whenever a file of a certain <glossary
+    ref="mime-type">MIME content type</glossary> is requested. The
     <directive module="mod_actions">Script</directive> directive lets
     you run CGI scripts whenever a particular method is used in a
     request. This makes it much easier to execute scripts that process
-    files.</p>
-</summary>
+    files.</p> </summary>
 
 <seealso><module>mod_cgi</module></seealso>
 <seealso><a href="../howto/cgi.html">Dynamic Content with CGI</a></seealso>
-<seealso><a href="../handler.html">Apache's Handler Use</a></seealso>
+<seealso><a href="../handler.html">Apache httpd's Handler Use</a></seealso>
 
 <directivesynopsis>
 <name>Action</name>
@@ -53,38 +54,43 @@ content-type</description>
 <context>directory</context><context>.htaccess</context>
 </contextlist>
 <override>FileInfo</override>
-<compatibility>The <code>virtual</code> modifier and handler passing were
-introduced in Apache 2.1</compatibility>
 
 <usage>
     <p>This directive adds an action, which will activate
-    <var>cgi-script</var> when <var>action-type</var> is triggered by the
-    request.  The <var>cgi-script</var> is the URL-path to a resource
-    that has been designated as a CGI script using <directive
+    <var>cgi-script</var> when <var>action-type</var> is triggered by
+    the request.  The <var>cgi-script</var> is the URL-path to a
+    resource that has been designated as a CGI script using <directive
     module="mod_alias">ScriptAlias</directive> or <directive
     module="mod_mime">AddHandler</directive>.  The
     <var>action-type</var> can be either a <a
-    href="../handler.html">handler</a> or a MIME content type. It
-    sends the URL and file path of the requested document using the
-    standard CGI <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code>
-    environment variables. The handler used for the particular request is
-    passed using the <code>REDIRECT_HANDLER</code> variable.</p>
-
-    <example><title>Examples</title>
-      # Requests for files of a particular MIME content type:<br />
-      Action image/gif /cgi-bin/images.cgi<br />
-      <br />
-      # Files of a particular file extension<br />
-      AddHandler my-file-type .xyz<br />
-      Action my-file-type /cgi-bin/program.cgi<br />
+    href="../handler.html">handler</a> or a <glossary
+    ref="mime-type">MIME content type</glossary>. It sends the URL and
+    file path of the requested document using the standard CGI
+    <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code>
+    environment variables. The handler used for the particular request
+    is passed using the <code>REDIRECT_HANDLER</code> variable.</p>
+
+    <example><title>Example: MIME type</title>
+    <highlight language="config">
+# Requests for files of a particular MIME content type:
+Action image/gif /cgi-bin/images.cgi
+    </highlight>
     </example>
 
-    <p>In the first example, requests for files with a MIME content
+    <p>In this example, requests for files with a MIME content
     type of <code>image/gif</code> will be handled by the
     specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
 
-    <p>In the second example, requests for files with a file extension of
-    <code>.xyz</code> are handled by the specified cgi script 
+    <example>
+        <title>Example: File extension</title>
+    <highlight language="config">
+# Files of a particular file extension
+AddHandler my-file-type .xyz
+Action my-file-type /cgi-bin/program.cgi
+    </highlight>
+    </example>
+    <p>In this example, requests for files with a file extension of
+    <code>.xyz</code> are handled by the specified cgi script
     <code>/cgi-bin/program.cgi</code>.</p>
 
     <p>The optional <code>virtual</code> modifier turns off the check
@@ -92,14 +98,12 @@ introduced in Apache 2.1</compatibility>
     if you want to use the <directive>Action</directive> directive in
     virtual locations.</p>
 
-    <example><title>Example</title>
-      &lt;Location /news&gt;<br />
-      <indent>
-        SetHandler news-handler<br />
-        Action news-handler /cgi-bin/news.cgi virtual<br />
-      </indent>
-      &lt;/Location&gt;
-    </example>
+    <highlight language="config">
+&lt;Location "/news"&gt;
+    SetHandler news-handler
+    Action news-handler /cgi-bin/news.cgi virtual
+&lt;/Location&gt;
+    </highlight>
 </usage>
 
 <seealso><directive module="mod_mime">AddHandler</directive></seealso>
@@ -121,7 +125,7 @@ method.</description>
     module="mod_alias">ScriptAlias</directive> or <directive
     module="mod_mime">AddHandler</directive>.  The URL and
     file path of the requested document is sent using the standard CGI
-    <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> environment 
+    <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> environment
     variables.</p>
 
     <note>
@@ -131,21 +135,21 @@ method.</description>
       effects.
     </note>
 
-    <p>Note that the <directive>Script</directive> command defines default 
+    <p>Note that the <directive>Script</directive> 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 <directive>Script</directive> with a method of 
+    so. Also note that <directive>Script</directive> with a method of
     <code>GET</code> will only be called if there are query arguments present
     (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
     proceed normally.</p>
 
-    <example><title>Examples</title>
-      # For &lt;ISINDEX&gt;-style searching<br />
-      Script GET /cgi-bin/search<br />
-      <br />
-      # A CGI PUT handler<br />
-      Script PUT /~bob/put.cgi<br />
-    </example>
+    <highlight language="config">
+# All GET requests go here
+Script GET /cgi-bin/search
+
+# A CGI PUT handler
+Script PUT /~bob/put.cgi
+    </highlight>
 </usage>
 </directivesynopsis>