Hi Kevin,

It sounds like Chuck already pointed to the most valuable resources. Keep in mind that cgi is supported by tomcat but may not necessarily be the best option for future development. If you're using legacy code, that's a different story and so sometimes its the only option. I've found that JSP can do pretty much whatever you would want to do with CGI, but a lot easier (especially the way it interfaces with java classes that you may already be using for a particular servlet).

Anyhow... since the WEB-INF subdirectory of each servlet hides its contents, it is the preferred place to put cgi files. In the past, imprudent cgi programmers would place their scripts in a folder that was readable by the public, and thus expose the bowels of their scripts (and sometimes therefore, the bowels of their system configuration). This is why tomcat wants you to place your scripts in the WEB-INF folders. There are multiple WEB-INF folders, so if you're using a theoretical servlet "helloworld," you would place your cgi script in "/helloworld/WEB-INF/cgi/" and the URL which tomcat maps to that location is just "/helloworld/cgi-bin/yourscript.cgi" . If you're one of those folks who like to use shtml files with execute cgi's, then you'll also have to enable SSI (in addition to CGI) in your tomcat-5.5/conf/web.xml file. The changes to web.xml are minimal, apache already wrote the code, all you have to do is search for "CGI" or "SSI" and uncomment xml code blocks.

--Rob

Kevin Mullin wrote:

I'm using the book "Tomcat: the definitive guide" from O'reilly, but it was written for Tomcat 4.x, and I'm using 5.5.17. In doing things to enable servlet processing it says (on pg. 65, step 4) to:

Either place the CGI scripts under the WEB-INF/cgi directory ....

well, I have lots of WEB-INF directories, I suspect it wants me to do it in the ROOT/WEB-INF. However, I don't have a cgi directory anywhere. Can somebody tell me what I need to do (in addition to the changes in web.xml) to enable CGI processing in Tomcat?
*


Kevin Mullin
Sr. Analyst
IBM Corporation**
(206) 345-7068
[EMAIL PROTECTED]       <http://www.ibm.com/ibm/values/>





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to