Pages

Search This Blog

Tuesday, 18 October 2011

CONFIGURING TOMCAT FOR CGI

The CGI (Common Gateway Interface) defines a way for a web server to interact with external content-generating programs, which are often referred to as CGI programs or CGI scripts.

Steps to run perl script:
1.Rename $CATALINA_BASE/server/lib/servlets-cgi.renametojar to $CATALINA_BASE/server/lib/servlets-cgi.jar.

2.Remove the XML comments from around the CGI servlet and servlet-mapping configuration in $CATALINA_BASE/conf/web.xml.


 3. There are several servlet init parameters which can be used to configure the behaviour of the CGI servlet.
  • cgiPathPrefix - The CGI search path will start at the web application root directory + File.separator + this prefix. The default cgiPathPrefix is /WEB-INF/cgi
  • debug - Debugging detail level for messages logged by this servlet. Default 0.
  • executable - The of the executable to be used to run the script. Default is perl.(location of the exe file of perl)
  • passShellEnvironment - Should the shell environment variables (if any) be passed to the CGI script? Default is false. Set it to true
Note: Restart the web server (not by refreshing the browser)

No comments:

Post a Comment