Running Perl Script in Jakarta Tomcat Server (Continued)
Now that you have added the necessary environment variables, you need to also change some Tomcat Web server files. Here is a list of items for you to change in Tomcat to make Perl scripts work.
- Change c:\Jakarta-tomcat-4.1.18\server\lib\servlets-cgi.renametojar to c:\Jakarta-tomcat-4.1.18\server\lib\servlets-cgi.jar.
- Change c:\Jakarta-tomcat-4.1.18\server\lib\servlets-ssi.renametojar to c:\Jakarta-tomcat-4.1.18\server\lib\servlets-ssi.jar. (See Figure 2 to see where these files are located.)
- Because we are going to use the "examples" Web app that comes with Tomcat, you need to add this subdirectory: c:\Jakarta-tomcat-4.1.18\webapps\examples\WEB-INF\cgi. (See Figure 3 to see what your directory structure should look like after adding this subdirectory.)
- The last item to change is the web.xml file that is located at c:\Jakarta-tomcat-4.1.18\conf\web.xml. Open this file in a text editor and uncomment these lines of code (just remove the <!-- and --> to uncomment the code).
<!--
<servlet>
<servlet-name>cgi
</servlet-name>
<servlet-class>
org.apache.catalina.
servlets.CGIServlet
</servlet-class>
<init-param>
<param-name>
clientInputTimeout
</param-name>
<param-value>100
</param-value>
</init-param>
<init-param>
<param-name>debug
</param-name>
<param-value>6
</param-value>
</init-param>
<init-param>
<param-name>
cgiPathPrefix
</param-name>
<param-value>
WEB-INF/cgi
</param-value>
</init-param>
<load-on-startup>5
</load-on-startup>
</servlet>
-->
5. Change mapping for the cgi servlet inside the web.xml file. In this script, you need to uncomment the <servlet-mapping> by removing the <!-- and -->.
<!-- The mapping for the
CGI Gateway servlet -->
<!--
<servlet-mapping>
<servlet-name>cgi
</servlet-name>
<url-pattern>/cgi-bin/*
</url-pattern>
</servlet-mapping>
-- >
Back to top
|