tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Burma <...@seapine.com>
Subject Tomcat 5.0.16 executes binary CGI scripts as Perl scripts
Date Thu, 18 Dec 2003 14:48:13 GMT
I am new to 5.0.16 but I have used Tomcat before in the Past. I think I 
configured my CGI settings correctly according to the documentation, I 
uncommented the servlet and servlet-mappings sections, renamed the Jar 
file. I also have .exe MIME mapped as an Application (the default values I 
didn't muck with any of these).

I am running on Windows 2000. My script is installed into 
..\Root\WEB-INF\cgi\cgi.exe

I am trying to run a binary C-Style CGI script. It appears that tomcat is 
treating my .exe file as a Perl script. The 500 Error Output reads...

java.io.IOException: CreateProcess: perl "C:\Program Files\Apache Software 
Foundation\Tomcat 5.0\webapps\ROOT\WEB-INF\cgi\cgi.exe" error=2

I am not sure how to resolve this issue, it looks like from the error 
Tomcat thinks me exe is a perl script. I didn't know there was a specific 
configuration for how scripts are handled, it appears the MIME mappings are 
being ignored or are not used in script execution.

Any ideas, is there a way to unmap .exe to perl?

I know Tomcat is designed primarily for  servlets, this is a special 
scenario where Tomcat cannot be substituted for Apache (and Apache runs the 
script A-OK).

---------- Below are specific details about the error msg and web.xml 
config settings  -------------

Entire error:

2003-12-17 18:41:25 StandardContext[]cgi: findCGI: currentLoc=C:\Program 
Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT\WEB-INF\cgi
2003-12-17 18:41:25 StandardContext[]cgi: findCGI: FOUND cgi at C:\Program 
Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT\WEB-INF\cgi\cgi.exe
2003-12-17 18:41:25 StandardContext[]cgi: findCGI calc: name=cgi.exe, 
path=C:\Program Files\Apache Software Foundation\Tomcat 
5.0\webapps\ROOT\WEB-INF\cgi\cgi.exe, scriptname=/cgi-bin\cgi.exe, 
cginame=\cgi.exe
2003-12-17 18:41:25 StandardContext[]cgi: 
runCGI(envp=[{HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 
5.1; iOpus-I-M; .NET CLR 1.0.3705; .NET CLR 1.1.4322), 
HTTP_ACCEPT_ENCODING=gzip, deflate, REQUEST_METHOD=GET, AUTH_TYPE=, 
HTTP_ACCEPT_LANGUAGE=en-us,de;q=0.5, SERVER_NAME=pinecone, 
SERVER_SOFTWARE=TOMCAT, HTTP_HOST=pinecone, GATEWAY_INTERFACE=CGI/1.1, 
X_TOMCAT_SCRIPT_PATH=C:\Program Files\Apache Software Foundation\Tomcat 
5.0\webapps\ROOT\WEB-INF\cgi\cgi.exe, REMOTE_ADDR=192.168.1.144, 
SERVER_PROTOCOL=HTTP/1.1, PATH_INFO=, REMOTE_HOST=192.168.1.144, 
QUERY_STRING=command=LoginScreen, HTTP_CONNECTION=Keep-Alive, 
SERVER_PORT=8080, CONTENT_TYPE=, CONTENT_LENGTH=, 
SCRIPT_NAME=/cgi-bin\cgi.exe, HTTP_ACCEPT=*/*, REMOTE_USER=, 
REMOTE_IDENT=}], command=C:\Program Files\Apache Software Foundation\Tomcat 
5.0\webapps\ROOT\WEB-INF\cgi\cgi.exe)
2003-12-17 18:41:25 StandardWrapperValve[cgi]: Servlet.service() for 
servlet cgi threw exception
java.io.IOException: CreateProcess: perl "C:\Program Files\Apache Software 
Foundation\Tomcat 5.0\webapps\ROOT\WEB-INF\cgi\cgi.exe" error=2
         at java.lang.Win32Process.create(Native Method)
         at java.lang.Win32Process.<init>(Win32Process.java:66)
         at java.lang.Runtime.execInternal(Native Method)
         at java.lang.Runtime.exec(Runtime.java:566)
         at java.lang.Runtime.exec(Runtime.java:428)
         at 
org.apache.catalina.servlets.CGIServlet$CGIRunner.run(CGIServlet.java:1578)
         at org.apache.catalina.servlets.CGIServlet.doGet(CGIServlet.java:626)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
         at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
         at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
         at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
         at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
         at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
         at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
         at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
         at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
         at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
         at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:696)
         at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
         at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
         at java.lang.Thread.run(Thread.java:534)

Current Web.xml Config....


     <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>

    <!-- The mapping for the CGI Gateway servlet -->
     <servlet-mapping>
         <servlet-name>cgi</servlet-name>
         <url-pattern>/cgi-bin/*</url-pattern>
     </servlet-mapping>

-Pa

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message