Author: kkolinko Date: Thu Nov 20 05:09:29 2014 New Revision: 1640677 URL: http://svn.apache.org/r1640677 Log: CTR: documentation and comments 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 r1640675 from tomcat/tc7.0.x/trunk. Modified: tomcat/tc6.0.x/trunk/ (props changed) tomcat/tc6.0.x/trunk/conf/web.xml tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java tomcat/tc6.0.x/trunk/webapps/docs/cgi-howto.xml tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc6.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1640655-1640658 Merged /tomcat/tc7.0.x/trunk:r1640675 Merged /tomcat/tc8.0.x/trunk:r1640674 Modified: tomcat/tc6.0.x/trunk/conf/web.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/conf/web.xml?rev=1640677&r1=1640676&r2=1640677&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/conf/web.xml (original) +++ tomcat/tc6.0.x/trunk/conf/web.xml Thu Nov 20 05:09:29 2014 @@ -335,7 +335,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/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java?rev=1640677&r1=1640676&r2=1640677&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java Thu Nov 20 05:09:29 2014 @@ -124,7 +124,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/tc6.0.x/trunk/webapps/docs/cgi-howto.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/cgi-howto.xml?rev=1640677&r1=1640676&r2=1640677&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/cgi-howto.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/cgi-howto.xml Thu Nov 20 05:09:29 2014 @@ -61,11 +61,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 +94,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 +108,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> </p> Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1640677&r1=1640676&r2=1640677&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu Nov 20 05:09:29 2014 @@ -43,6 +43,17 @@ <!-- Section names: General, Catalina, Coyote, Jasper, Cluster, Web applications, Other --> +<section name="Tomcat 6.0.44 (markt)"> + <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> +</section> <section name="Tomcat 6.0.43 (markt)"> <subsection name="Catalina"> <changelog> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org