tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From A Madhusudan-A5324C <A53...@motorola.com>
Subject Enabling CGI/Perl in Tomcat 5.5.9
Date Wed, 17 Aug 2005 12:13:42 GMT
Hi,

I am facing some problems with enabling CGI in Tomcat 5.5.9.

I followed the instructions given in the Manual, and renamed the
servlets-cgi.renametojar under jakarta-tomcat-5.5.9\server\lib\ to
servlets-cgi.jar.

Further I modified the web.xml files to uncomment the CGI enabling part.
Here they are

    <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>executable</param-name>
          <param-value>/usr/local/bin/perl</param-value>
        </init-param>
        <init-param>
          <param-name>cgiPathPrefix</param-name>
          <param-value>/</param-value>
        </init-param>
         <load-on-startup>5</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>cgi</servlet-name>
        <url-pattern>/3gcgi/*</url-pattern>
    </servlet-mapping>

My context.xml file points to a directory outside the tomcat dir structure.
It is

<Context path="/3gflex" docBase="/usr/prod/3gflex" allowLinking="true"
debug="0">

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat
restarts -->
    <!--
    <Manager pathname="" />
    -->
    <Resources className="org.apache.naming.resources.FileDirContext"
allowLinking="true" />
</Context>

The problem I am facing is that whatever perl scripts I have stored under
/usr/prob/3gflex/, does not execute. But any perl script under any directory
under /usr/prob/3gflex/ executes perfectly. The same if copied one level
above fails. The error thrown is given below......

java.lang.StringIndexOutOfBoundsException: String index out of range: -2
	java.lang.String.substring(String.java:1480)
	java.lang.String.substring(String.java:1447)
	
org.apache.catalina.servlets.CGIServlet$CGIEnvironment.findCGI(CGIServlet.ja
va:942)
	
org.apache.catalina.servlets.CGIServlet$CGIEnvironment.setCGIEnvironment(CGI
Servlet.java:1009)
	
org.apache.catalina.servlets.CGIServlet$CGIEnvironment.<init>(CGIServlet.jav
a:787)
	org.apache.catalina.servlets.CGIServlet.doGet(CGIServlet.java:591)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


Can anyone please hep me on this one..

Thanks
Madhusudan

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message