PXN8 and Tomcat

Here are instructions for configuring tomcat to run perl programs.

First you must edit your $TOMCAT_HOME/conf/web.xml file to enable the CGI servlet. This may not be enabled by default. To do so add the following text to your web.xml file…

    <servlet>
        <servlet-name>cgi</servlet-name>
        <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
        <init-param>
          <param-name>debug</param-name>
          <param-value>6</param-value>
        </init-param>
        <init-param>
          <param-name>cgiPathPrefix</param-name>
          <param-value>.</param-value>
        </init-param>
        <init-param>
          <param-name>passShellenvironment</param-name>
          <param-value>true</param-value>
        </init-param>
        <load-on-startup>5</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>cgi</servlet-name>
        <url-pattern>*.pl</url-pattern>
    </servlet-mapping>

Next you must rename the following file…

$TOMCAT_HOME/server/lib/servlets-cgi.renametojar
$TOMCAT_HOME/server/lib/servlets-cgi.jar

Stop and restart tomcat and you should be able to call the pxn8.pl perl script.

Advertisements

One thought on “PXN8 and Tomcat

  1. And in order to use it with Resin from Caucho, just replace org.apache.catalina.servlets.CGIServlet with com.caucho.servlets.CGIServlet and it should work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: