You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Havens, Peter" <pe...@hp.com> on 2004/08/14 02:25:01 UTC
CGI for tomcat on linux
Hello all,
I am trying to get CGI working on tomcat 4.1.29 in a RedHat Linux
environment. I have all ready got it working on my Windows environment
and it is working great. It seems to be quite easy and I followed the
instructions exactly as they are found here:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/cgi-howto.html
I did these same steps on both my Windows and my LINUX box but I keep
getting an error 500 on my LINUX box. I have included the exception
that I am seeing on the browser when I try to access my cgi executable.
I have tried many different executables and scripts but I always get the
same response.
There error seems to imply that the cgi file that I am trying to run
does not exist. I have validated its location and the permissions to
the file are wide open.
Has anyone run in to this before or do you know why I am getting this?
Thanks in advance,
-Peter
Below is the exception report
------------------------------------------------------------------------
----
HTTP Status 500
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
java.io.IOException: java.io.IOException:
"/opt/hpwebadmin/webapps/mxhelp/WEB-INF/cgi/namazucgi": not found
at java.lang.UNIXProcess.(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at
org.apache.catalina.servlets.CGIServlet$CGIRunner.run(CGIServlet.java:15
92)
at
org.apache.catalina.servlets.CGIServlet.doGet(CGIServlet.java:635)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFi
lterChain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterC
hain.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:172)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:494)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va:246)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241
7)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:
376)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:78
1)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:549)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58
9)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:666)
at java.lang.Thread.run(Unknown Source)
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: CGI for tomcat on linux
Posted by QM <qm...@brandxdev.net>.
On Fri, Aug 13, 2004 at 05:25:01PM -0700, Havens, Peter wrote:
: I did these same steps on both my Windows and my LINUX box but I keep
: getting an error 500 on my LINUX box.
: [snip]
: There error seems to imply that the cgi file that I am trying to run
: does not exist. I have validated its location and the permissions to
: the file are wide open.
:
: java.io.IOException: java.io.IOException:
: "/opt/hpwebadmin/webapps/mxhelp/WEB-INF/cgi/namazucgi": not found
You say the perms are "wide open" on the file -- specifically, what are
they? Is the file executable?
What's the first line of the script? Is it
#!/path/to/your/perl
(where the path is "/usr/bin/perl" under most default Linux installs)
Windows and Linux execute scripts in different ways; the former
associates a file extension with an executable, whereas the latter sets
the interpreter in the script itself.
Try to run the script from the commandline. If the executable
referenced by the magic number (aka shebang, aka "#!") isn't there,
you'll get the "file not found" error.
I haven't run CGI under Tomcat 4 but I recall in Tomcat 5 you can
expressly state which interpreter to use in the <Context> element.
-QM
--
software -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: CGI for tomcat on linux
Posted by Wade Chandler <wc...@redesetgrow.com>.
Havens, Peter wrote:
> Hello all,
>
> I am trying to get CGI working on tomcat 4.1.29 in a RedHat Linux
> environment. I have all ready got it working on my Windows environment
> and it is working great. It seems to be quite easy and I followed the
> instructions exactly as they are found here:
>
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/cgi-howto.html
>
> I did these same steps on both my Windows and my LINUX box but I keep
> getting an error 500 on my LINUX box. I have included the exception
> that I am seeing on the browser when I try to access my cgi executable.
> I have tried many different executables and scripts but I always get the
> same response.
>
> There error seems to imply that the cgi file that I am trying to run
> does not exist. I have validated its location and the permissions to
> the file are wide open.
>
> Has anyone run in to this before or do you know why I am getting this?
>
> Thanks in advance,
>
> -Peter
>
> Below is the exception report
>
> ------------------------------------------------------------------------
> ----
>
> HTTP Status 500
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented
> it from fulfilling this request.
>
> exception
>
> java.io.IOException: java.io.IOException:
> "/opt/hpwebadmin/webapps/mxhelp/WEB-INF/cgi/namazucgi": not found
> at java.lang.UNIXProcess.(Unknown Source)
> at java.lang.Runtime.execInternal(Native Method)
> at java.lang.Runtime.exec(Unknown Source)
> at java.lang.Runtime.exec(Unknown Source)
> at
> org.apache.catalina.servlets.CGIServlet$CGIRunner.run(CGIServlet.java:15
> 92)
> at
> org.apache.catalina.servlets.CGIServlet.doGet(CGIServlet.java:635)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:247)
> at
> org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFi
> lterChain.java:98)
> at
> org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterC
> hain.java:176)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
> erChain.java:172)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
> e.java:256)
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> nvokeNext(StandardPipeline.java:643)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 80)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
> e.java:191)
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> nvokeNext(StandardPipeline.java:643)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
> Base.java:494)
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> nvokeNext(StandardPipeline.java:641)
> at
> org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
> va:246)
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> nvokeNext(StandardPipeline.java:641)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 80)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241
> 7)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :180)
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> nvokeNext(StandardPipeline.java:643)
> at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
> lve.java:171)
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> nvokeNext(StandardPipeline.java:641)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :172)
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> nvokeNext(StandardPipeline.java:641)
> at
> org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:
> 376)
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> nvokeNext(StandardPipeline.java:641)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 80)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
> java:174)
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> nvokeNext(StandardPipeline.java:643)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
> 80)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> at
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:78
> 1)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
> onnection(Http11Protocol.java:549)
> at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58
> 9)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
> .java:666)
> at java.lang.Thread.run(Unknown Source)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
Don't forget that your file system is more than likely case sensitive.
People run into this alot on Linux when they are used to windows. CGI,
cGI, CgI, etc etc etc....is the same on windows and yet would be
different on Linux. There are file systems that are case insensitive,
but all the common file systems are case sensitive.
Wade
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org