Wah, it's really a hard time to search and understand the pieces of relevant information. I have spent whole morning and finally success. The following are the main steps to setup CGI environment in Window XP with Apache Tomcat server. The IIS may also be used as the server.
- Install Perl: I obtained the installer from "http://www.activestate.com/activeperl/"
- Install Apache Tomcat Server: I obtained the installer from "http://tomcat.apache.org/download-60.cgi"
- Uncomment cgi portion in "conf/web.xml" at Apache root folder
- Insert "privileged="true"" in context element of respective xml file of the web applications
- By default in "web.xml", the cgi scripts should be placed in "WEB-INF/cgi". The following is the sample cgi script for testing:
#!perlroot/bin/perl.exe
print "Content-type: text/html\n\n" ;
print <<HTML ;
<html>
<head><title>CGI Results</title></head>
<body>
<h1>Hello, world.</h1>
</body>
</html>
HTML - By default, the cgi scripts can be accessed under "cgi-bin" at the root of web application
You can refer to http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html for more details to setup cgi environment in Apache Tomcat 6.0. The debug information can be found in "logs" folder at Apache root folder.
No comments:
Post a Comment