Craig et. al.,

    I have put together an alpha version of the CGI emulation servlet 
listed as a todo in the Tomcat 4.0/4.1 Catalina TODO list (Servlet 
Provided Functionality section).

    This is my first submission for review, so I expect there will be a 
lot of pointers/comments on the (lack of) coding style, structure, etc. 
  Please bring it on, otherwise I will never know.

    Per list instructions, the zipfile (~43KB) with the set of files 
(one source, one test CGI, a fair number of Javadoc-created files) is 
posted at:

    http://www.martindengler.com/proj/CGIGatewayServlet.zip

    As I am not fully there on how you want the relationship between the 
servlets and the web-app content (in this case, the cgi script) to go, 
for now I just included a README file with the necessary steps to get 
something running presuming an up-to-date CVS source version.

     The README file is included as an attachment to this message for 
ease of browsing.  It basically works by assuming the Tomcat 
jakarta-tomcat-4.1 cvs module is in a directory whose peer is the build 
directory.  Everything follows from there.

     I plan on continuing to complete the quality/design of the code so 
any comments on style, structure, README, web-app relationships, etc. 
are welcomed.


Chrs,
Martin
IMPORTANT:  this has only been tested against Tomcat 4.1-dev


Please contact Martin Dengler [[EMAIL PROTECTED]] with any questions


1) cd $TOMCAT_HOME

2) unzip CGIGatewayServlet.zip

   This will create the following files/directories:

   -  jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/servlets
         ... CGIGatewayServlet.java

   -  build/tomcat-4.1/webapps/ROOT
         ... /cgidir
         ... /cgidir/testcgi.sh
         ... /cgidir/index.html   [JAVADOC]
         ... /cgidir/[other javadoc files]

3) ensure the script is executable:

   chmod a+x build/tomcat-4.1/webapps/ROOT/cgidir/testcgi.sh

4) add a mapping for the CGIGatewayServlet in the Tomcat web.xml (or
   any webapp's web.xml that you prefer):
   
   build/tomcat-4.1/conf/web.xml:
   ... servlet definition:
     <!-- The CGI Gateway servlet that executes cgi scripts -->
       <servlet>
           <servlet-name>cgiGateway</servlet-name>
               <servlet-class>org.apache.catalina.servlets.CGIGatewayServlet
               </servlet-class>
                   <init-param>
                         <param-name>debug</param-name>
                         <param-value>3</param-value>
                   </init-param>
                   <init-param>
                         <param-name>clientInputTimeout</param-name>
                         <param-value>100</param-value>
                   </init-param>
           <load-on-startup>5</load-on-startup>
        </servlet>


   ... servlet mapping section:

     <!-- The mapping for the CGI Gateway servlet -->
     <!-- Comment this out if you do not want "CGI Gateway" service -->
       <servlet-mapping>
           <servlet-name>cgiGateway</servlet-name>
               <url-pattern>/cgi-bin/*</url-pattern>
       </servlet-mapping>



5) rebuild tomcat (only the one file & dependant jar should change):
   
   cd jakarta-tomcat-4.1
   ./build.sh

6) restart tomcat

7) access http://localhost:8080/cgi-bin/cgidir/testcgi.sh to test



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to