You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2014/11/20 05:59:49 UTC

svn commit: r1640674 - in /tomcat/tc8.0.x/trunk: ./ conf/web.xml java/org/apache/catalina/servlets/CGIServlet.java webapps/docs/cgi-howto.xml webapps/docs/changelog.xml

Author: kkolinko
Date: Thu Nov 20 04:59:49 2014
New Revision: 1640674

URL: http://svn.apache.org/r1640674
Log:
Update CGI-howto.
Recommend to copy the servlet into one's own web application instead of uncommenting it globally.
The default value for cgiPathPrefix is null. The "WEB-INF/cgi" value is the recommended one and used in conf/web.xml example.

Merged r1640655, r1640658 from tomcat/trunk.

Modified:
    tomcat/tc8.0.x/trunk/   (props changed)
    tomcat/tc8.0.x/trunk/conf/web.xml
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java
    tomcat/tc8.0.x/trunk/webapps/docs/cgi-howto.xml
    tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc8.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1640655-1640658

Modified: tomcat/tc8.0.x/trunk/conf/web.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/conf/web.xml?rev=1640674&r1=1640673&r2=1640674&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/conf/web.xml (original)
+++ tomcat/tc8.0.x/trunk/conf/web.xml Thu Nov 20 04:59:49 2014
@@ -317,7 +317,8 @@
   <!--                                                                      -->
   <!--   cgiPathPrefix        The CGI search path will start at             -->
   <!--                        webAppRootDir + File.separator + this prefix. -->
-  <!--                        [WEB-INF/cgi]                                 -->
+  <!--                        If not set, then webAppRootDir is used.       -->
+  <!--                        Recommended value: WEB-INF/cgi                -->
   <!--                                                                      -->
   <!--   debug                Debugging detail level for messages logged    -->
   <!--                        by this servlet.  [0]                         -->

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java?rev=1640674&r1=1640673&r2=1640674&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java Thu Nov 20 04:59:49 2014
@@ -123,7 +123,7 @@ import org.apache.catalina.util.IOTools;
  * or an instance where the specification cited differs from Best
  * Community Practice (BCP).
  * Such instances should be well-documented here.  Please email the
- * <a href="mailto:dev@tomcat.apache.org">Tomcat group [dev@tomcat.apache.org]</a>
+ * <a href="http://tomcat.apache.org/lists.html">Tomcat group</a>
  * with amendments.
  *
  * </p>

Modified: tomcat/tc8.0.x/trunk/webapps/docs/cgi-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/cgi-howto.xml?rev=1640674&r1=1640673&r2=1640674&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/cgi-howto.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/cgi-howto.xml Thu Nov 20 04:59:49 2014
@@ -23,7 +23,6 @@
     &project;
 
     <properties>
-        <author email="glenn@apache.org">Glenn L. Nielsen</author>
         <title>CGI How To</title>
     </properties>
 
@@ -61,11 +60,29 @@ this servlet is mapped to the URL patter
 external to the Tomcat JVM. If you are using the Java SecurityManager this
 will bypass your security policy configuration in <code>catalina.policy.</code></p>
 
-<p>Remove the XML comments from around the CGI servlet and servlet-mapping
-configuration in <code>$CATALINA_BASE/conf/web.xml</code>.</p>
+<p>To enable CGI support:</p>
 
-<p>Only Contexts which are marked as privileged may use the CGI servlet (see the
-privileged property of the Context element).</p>
+<ol>
+<li><p>There are commented-out sample servlet and servlet-mapping elements for
+CGI servlet in the default <code>$CATALINA_BASE/conf/web.xml</code> file.
+To enable CGI support in your web application, copy that servlet and
+servlet-mapping declarations into <code>WEB-INF/web.xml</code> file of your
+web application.</p>
+
+<p>Uncommenting the servlet and servlet-mapping in
+<code>$CATALINA_BASE/conf/web.xml</code> file enables CGI for all installed
+web applications at once.</p>
+</li>
+
+<li><p>Set <code>privileged="true"</code> on the Context element for your
+web application.</p>
+
+<p>Only Contexts which are marked as privileged are allowed to use the
+CGI servlet. Note that modifying the global <code>$CATALINA_BASE/conf/context.xml</code>
+file affects all web applications. See
+<a href="config/context.html">Context documentation</a> for details.</p>
+</li>
+</ol>
 
 </section>
 
@@ -76,9 +93,11 @@ configure the behaviour of the CGI servl
 <ul>
 <li><strong>cgiPathPrefix</strong> - The CGI search path will start at
 the web application root directory + File.separator + this prefix.
-The default cgiPathPrefix is <code>WEB-INF/cgi</code></li>
+By default there is no value, which results in the web application root
+directory being used as the search path. The recommended value is
+<code>WEB-INF/cgi</code></li>
 <li><strong>debug</strong> - Debugging detail level for messages logged
-by this servlet. Default 0.</li>
+by this servlet. Default is <code>0</code>.</li>
 <li><strong>executable</strong> - The of the executable to be used to
 run the script. You may explicitly set this parameter to be an empty string
 if your script is itself executable (e.g. an exe file). Default is
@@ -88,13 +107,14 @@ and so on - additional arguments for the
 CGI script name. By default there are no additional arguments.</li>
 <li><strong>parameterEncoding</strong> - Name of the parameter encoding
 to be used with the CGI servlet. Default is
-<code>System.getProperty("file.encoding","UTF-8")</code>.</li>
+<code>System.getProperty("file.encoding","UTF-8")</code>. That is the system
+default encoding, or UTF-8 if that system property is not available.</li>
 <li><strong>passShellEnvironment</strong> - Should the shell environment
-variables (if any) be passed to the CGI script? Default is
+variables from Tomcat process (if any) be passed to the CGI script? Default is
 <code>false</code>.</li>
 <li><strong>stderrTimeout</strong> - The time (in milliseconds) to wait for
 the reading of stderr to complete before terminating the CGI process. Default
-is 2000.</li>
+is <code>2000</code>.</li>
 </ul>
 
 

Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1640674&r1=1640673&r2=1640674&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Thu Nov 20 04:59:49 2014
@@ -86,6 +86,15 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Web applications">
+    <changelog>
+      <fix>
+        Update documentation for CGI servlet. Recommend to copy the servlet
+        declaration into web application instead of enabling it globally.
+        Correct documentation for cgiPathPrefix. (kkolinko)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <update>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org