We have a web application running in Tomcat 6 on Ubuntu, and we want to run CGI scripts in Perl via the browser. 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 and http://www.wellho.net/solutions/java-running-cgi-scripts-in-apache-tomcat.html , seem simple enough, but they have not worked for us.
We already had set <context privileged="true"> in Tomcat's context.xml. 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/*. (We also tried cgi/* and cgi-bin/* , with no better results.) We downloaded servlets-cgi.renametojar from a Tomcat 5 distribution, copied it into $CATALINA_BASE/lib/, renamed it to servlets-cgi.jar, and put a symlink to it in usr/share/tomcat6/lib/. (Tomcat 6 did not come with this file. Nor, for that matter, can we find a preexisting cgi-bin directory anywhere.) After each step we restarted Tomcat, but when we browse to a CGI script in WEB-INF/cgi/ (we actually access it through a symlink in a different, publicly accessible directory), the browser displays it simply as text instead of running it as a Perl script. The first line of the file says #!/usr/bin/perl, and we have confirmed that we have a working Perl installation at that location. Shortly thereafter, the file tells us we haven't configured our Web server to run CGI scripts. We also tried modifying our web app's WEB-INF/web.xml instead of the $CATALINA_BASE/conf/web.xml, but no joy. I'm sure we're missing something obvious to those in the know, but it's not obvious to us. Any suggestions would be welcome. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org