Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Help -- running cgi with tomcat server

by l.frankline (Hermit)
on Apr 24, 2008 at 11:30 UTC ( [id://682611]=perlquestion: print w/replies, xml ) Need Help??

l.frankline has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

This could be an irrelevant question but I'm expecting a positive results from this website monks.

I have been struggling to execute Perl/CGI program on the web using tomcat 4.0 web server. I did all the configuration mentioned in the documentation CGI How-To, but all in vain.

I kept the perl/cgi files in the %TOMCAT_HOME%/webapps/ROOT/printenv.cgi, when requesting as http://localhost:8080/printenv.cgi, it is not compiled but displaying as a text file.

I could not figure out the problem, please help, your help is appreciated.

Thanks

Franklin

Don't put off till tomorrow, what you can do today.

Replies are listed 'Best First'.
Re: Help -- running cgi with tomcat server
by tachyon-II (Chaplain) on Apr 24, 2008 at 11:44 UTC

    Simple things first. Did you remember to mark printenv.pl as executable? (chmod 0755 printenv.cgi) Did you remember to restart Tomcat so it can pick up the config changes?

    If you have done that and it does not work you have obviously not done the configuration properly. Here is a more detailed installation guide You will note there is a mapping from cgi-bin/* to the cgi servelet. Your path looks very suspect to me. I think you need to create a cgi-bin (call it whatever you want just map it correctly). If you want to run cgi stuff anywhere map to *.pl or *.cgi but this is generally a bad idea as you will end up with code all over your server.

Re: Help -- running cgi with tomcat server
by sasdrtx (Friar) on Apr 24, 2008 at 11:53 UTC
    My guess is that you haven't set a mapping in your web.xml to match your filename. Here's a example snippet:
    <!-- The mapping for the CGI Gateway servlet --> <servlet-mapping> <servlet-name>cgi</servlet-name> <url-pattern>*.cgi</url-pattern> </servlet-mapping>
    The Tomcat-distributed example sets up a cgi-bin directory. You might look to see if that's what you defined, and try that instead. It's the more traditional approach.
    sas

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://682611]
Approved by Erez
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-20 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found