Welcome Guest!
Create Account | Login
Locator+ Code:

Search:
FTPOnline
Channels Conferences Resources Hot Topics Partner Sites Magazines About FTP RSS 2.0 Feed

Free Subscription to Java Pro


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.

  1. Change c:\Jakarta-tomcat-4.1.18\server\lib\servlets-cgi.renametojar to c:\Jakarta-tomcat-4.1.18\server\lib\servlets-cgi.jar.
  2. 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.)
  3. 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.)
  4. 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).
ADVERTISEMENT
<!--
   <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

Printer-Friendly Version












Java Pro | Visual Studio Magazine | Windows Server System Magazine
.NET Magazine | Enterprise Architect | XML & Web Services Magazine
VSLive! | Thunder Lizard Events | Discussions | Newsletters | FTP Home