running Perl/CGI scripts under Tomcat server

Reply

Join Date: Jan 2006
Posts: 237
Reputation: katharnakh is an unknown quantity at this point 
Solved Threads: 33
katharnakh's Avatar
katharnakh katharnakh is offline Offline
Posting Whiz in Training

running Perl/CGI scripts under Tomcat server

 
0
  #1
Feb 20th, 2007
Hi,

I have problem running my cgi scripts under Apache Tomcat server. I am
using Apache Tomcat/5.5.20 on WinXP. I followed the instruction tips I
found out at

http://www.wellho.net/forum/Perl-Pro...rl-CGI-scripts...

http://www.ftponline.com/javapro/200...den_03_18_03/p...

but still I could not get the scripts running.

I get HTTP status 404 error.

The directory structure I have is (Please ignore the line break)
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps
\examples #
this is folder I created it
\WEB-INF #
this is folder I created it
\cgi
# this is folder I created it
------> script1.cgi
------> script2.cgi

The script runs perfectly on Apache HTTPD server. Can any one tell me
clearly what needs to be done to get my script running.

Thank you,
Regards,
kath
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 237
Reputation: katharnakh is an unknown quantity at this point 
Solved Threads: 33
katharnakh's Avatar
katharnakh katharnakh is offline Offline
Posting Whiz in Training

Re: running Perl/CGI scripts under Tomcat server

 
0
  #2
Feb 20th, 2007
Originally Posted by katharnakh View Post
Hi,

I have problem running my cgi scripts under Apache Tomcat server. I am
using Apache Tomcat/5.5.20 on WinXP. I followed the instruction tips I
found out at

http://www.wellho.net/forum/Perl-Pro...rl-CGI-scripts...

http://www.ftponline.com/javapro/200...den_03_18_03/p...

but still I could not get the scripts running.

I get HTTP status 404 error.

The directory structure I have is (Please ignore the line break)
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps
\examples #
this is folder I created it
\WEB-INF #
this is folder I created it
\cgi
# this is folder I created it
------> script1.cgi
------> script2.cgi

The script runs perfectly on Apache HTTPD server. Can any one tell me
clearly what needs to be done to get my script running.

Thank you,
Regards,
kath

Hi,
I got it. The mistake I was doing was I was keeping the cgi folder in separate folder(examples) under webapps.
I need to keep the cgi/*.cgi in
../webapps/ROOT/WEB-INF folder.

But I don't know why server looks only in ROOT, might be default.
How can make server understand that the Perl/CGI scripts are kept in separate drive:/folder?


Thank you,
Regards,
kath.
Last edited by katharnakh; Feb 20th, 2007 at 2:26 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 4
Reputation: parani is an unknown quantity at this point 
Solved Threads: 0
parani parani is offline Offline
Newbie Poster

Re: running Perl/CGI scripts under Tomcat server

 
0
  #3
Apr 6th, 2007
Hi Katharnakh,

Can you please check the POST "Tomcat-Perl-Perl" and reply if you are aware of the problem?

Thanx
/Parani.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 2
Reputation: raj_3y2k is an unknown quantity at this point 
Solved Threads: 0
raj_3y2k raj_3y2k is offline Offline
Newbie Poster

Re: running Perl/CGI scripts under Tomcat server

 
0
  #4
Jun 24th, 2008
Hi,

I'm new to Perl, I installed ActivePerl in my machine and it is running properly. But when I'm trying to open a CGI using Tomcat I'm getting HTTP Status 404 error.

This is the directory I created C:\apache-tomcat-6.0.10\webapps\ROOT\WEB-INF\cgi and in the cgi folder I have a file named hello.cgi

hello.cgi contains the following code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "<html><head>\n";
print "<title>Hello, world!</title></head>\n";
print "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FF0000\" vlink=\"#800000\">\n";
print "<h1>Hello, world!</h1>\n";
print "<a href=\"../perl/tutorial.html\"><b>Back</b></a> to the Tutorial\n";
print "</body></html>\n";

Then I type http://localhost/hello.cgi in the browser I got HTTP Status 404 - /hello.cgi. The requested resource (/hello.cgi) is not available.

Can anyone help me regarding this problem

Thank you,
raj
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: running Perl/CGI scripts under Tomcat server

 
0
  #5
Jun 24th, 2008
At best the url is just wrong, you left out the cgi folder in the path:

http://localhost/cgi/hello.cgi

At worst your server is not setup correctly, but I know nothing of Tomcat, which is not a perl topic anyway, but an http server question. The fact you can't run the perl script has nothing to do with perl, but with the server.
Last edited by KevinADC; Jun 24th, 2008 at 11:16 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC