Thanks for your reply, Chuck.

(1) We do indeed have <Context privileged="true">.  The lower-case C was my 
typo.  I'm not sure why my collaborator decided to set the value here rather in 
the web app, but we have only one web app running on this machine anyway.
(2) We only copied servlets-cgi.renametojar after the steps in 
http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html failed to work.  Per 
your advice, I have now removed it.
(3) Here's what we currently have in $CATALINA_BASE/conf/web.xml:

    <servlet>
        <servlet-name>cgi</servlet-name>
        <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
        <init-param>
          <param-name>debug</param-name>
          <param-value>1</param-value>
        </init-param>
        <init-param>
          <param-name>cgiPathPrefix</param-name>
          <param-value>WEB-INF/cgi-bin</param-value>
        </init-param>
         <load-on-startup>5</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>cgi</servlet-name>
        <url-pattern>/cgi-bin/*</url-pattern>
    </servlet-mapping>

(4) Our web app is in /home/aceorg/aceorg/DEV-2.2/.  It has two branches, 
epoch-plugin/ and courseware/.  epoch-plugin/web/WEB-INF/ now contains 
cgi-bin/, which contains many cgi scripts, including login.cgi.  Most of our 
web app requires a login, so we are unable to point our browser to 
WEB-INF/cgi-bin/login.cgi directly.  However, we do have a public access folder 
at epoch-plugin/web/public/, which a Web browser can access at 
http://domain/epoch-plugin/public/, so I made a symlink public/webmo/cgi-bin to 
point to WEB-INF/cgi-bin.  When we point a browser to 
http://domain/epoch-plugin/public/webmo/cgi-bin/login.cgi, we see the text for 
WEB-INF/cgi-bin/login.cgi.

I have tried various other arrangements and names of the files, to no avail.  I 
also tried putting the above XML in WEB-INF/web.xml instead of 
$CATALINA_BASE/conf/web.xml, again to no avail.  I am ready to try anything you 
suggest.

________________________________
From: "Caldarale, Charles R" <chuck.caldar...@unisys.com>
Reply-To: Tomcat Users List <users@tomcat.apache.org>
Date: Tue, 12 Jan 2010 23:09:14 -0500
To: Tomcat Users List <users@tomcat.apache.org>
Conversation: how do I enable CGI scripts in Tomcat 6?
Subject: RE: how do I enable CGI scripts in Tomcat 6?

> From: Grossman, Robert B [mailto:robert.gross...@uky.edu]
> Subject: how do I enable CGI scripts in Tomcat 6?
>
> The descriptions of the CGI enabling process that we have found on
> the Web, e.g. http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html

That's the right one.

> and 
> http://www.wellho.net/solutions/java-running-cgi-scripts-in-apache-tomcat.html

Sadly out of date and seriously broken.  Use the real doc.

> We already had set <context privileged="true"> in Tomcat's context.xml.

That's wrong.  First, it's <Context>, not <context> - case matters.  Second, 
you shouldn't be setting this attribute globally, but rather in just the 
webapps that need it.

> We created a WEB-INF/cgi directory in our web app's hierarchy.  In
> $CATALINA_BASE/conf/web.xml, we uncommented the CGI servlet description
> and servlet matching, and we set the cgiPathPrefix to WEB-INF/cgi/ and
> the servlet matching pattern to /cgi/*.

Please post (via copy and paste) those sections of conf/web.xml so we can see 
what you actually did.  Too often people see what they expect, not what's there.

> We downloaded servlets-cgi.renametojar from a Tomcat 5 distribution,

Bad move.  Where in the Tomcat 6 doc does it say to do that?  You just broke 
your Tomcat 6 installation.

> Tomcat 6 did not come with this file.

Because it doesn't need it.

> Nor, for that matter, can we find a preexisting cgi-bin directory anywhere.

Nor should you.  That's simply a part of the URL that triggers the CGI servlet, 
not an actual directory.  The script path is specified by the cgiPathPrefix 
parameter.

> when we browse to a CGI script in WEB-INF/cgi/ (we actually access
> it through a symlink in a different, publicly accessible directory)

Don't muck with symlinks until you've got it working.  No point in introducing 
extra trouble spots until the basics are functional.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to