tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: How to run CGI script using Apache tomcat server?
Date Tue, 18 Nov 2014 18:21:44 GMT
Sumankumar Panchal wrote:
> Hello All,
> I would like to run CGI script using Apache tomcat server on Linux. I have
> added following lines in apache/conf/web.xml file.and create directory
> "cgi" inside WEB-INF with all necessary file/dir permission. Still I am
> unable to run CGI script.

When you say this, what do you mean ? In terms of being a helpful problem description, "I

am unable to run CGI script" ranks close to "it does not work"..

What happens when you try to send a request to Tomcat which should run the cgi script ?
Can you show the URL used ?
What kind of response do you get in the browser ? Do you you see the source code of the 
cgi script ? do you get some error, and if yes which one ?

Did you look at the Tomcat logfiles to see if there are any interesting messages showing 
why it does not do what you expect ?
If you do not understand the log messages, copy/paste them here, for someone to have a look.

Since you apparently did not define an "executable" to run your cgi-bin script, Tomcat 
assumes that it is perl. Is perl installed on your system ? Is your cgi-bin script a perl

script ?

Also, by the way, please indicate what version of Tomcat you are running, under which JVM

version, and on which platform OS (*).
It all saves time in the end, specially for you : the better the information you provide,

the sooner you will get a helpful response.

Note: a bonus point for having copied your configuration below, but you did not mention 
where you got these instructions from, or which web.xml file you are talking about.
(There is a general/default web.xml in (tomcat-dir)/conf, and another one under each of 
your webbapps WEB-INF sub-directory.)

(*) Ooops, sorry, you did say that.  But if it is Linux, then an additional question : did

you install Tomcat from the "official" version on the tomcat website, or did you install a

pre-packaged version from the Linux distribution ?

> can someone suggest me how to configure CGI environment in Apache Tomcat
> Server?
> web.xml
> -----------
>   <servlet>
>         <servlet-name>cgi</servlet-name>
> <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
>         <init-param>
>           <param-name>debug</param-name>
>           <param-value>0</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>
>     <servlet-mapping>
>         <servlet-name>cgi</servlet-name>
>         <url-pattern>/cgi-bin/*</url-pattern>
>     </servlet-mapping>
> Regards,
> Suman

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message