944,172 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 14717
  • Perl RSS
Feb 20th, 2007
0

running Perl/CGI scripts under Tomcat server

Expand 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
Similar Threads
Reputation Points: 19
Solved Threads: 34
Posting Whiz in Training
katharnakh is offline Offline
237 posts
since Jan 2006
Feb 20th, 2007
0

Re: running Perl/CGI scripts under Tomcat server

Click to Expand / Collapse  Quote originally posted by katharnakh ...
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.
Reputation Points: 19
Solved Threads: 34
Posting Whiz in Training
katharnakh is offline Offline
237 posts
since Jan 2006
Apr 6th, 2007
0

Re: running Perl/CGI scripts under Tomcat server

Hi Katharnakh,

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

Thanx
/Parani.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
parani is offline Offline
4 posts
since Jul 2006
Jun 24th, 2008
0

Re: running Perl/CGI scripts under Tomcat server

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
raj_3y2k is offline Offline
2 posts
since Jun 2008
Jun 24th, 2008
0

Re: running Perl/CGI scripts under Tomcat server

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.
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: Can you have any idea or algorithm about permutation of Keywords in Perl.
Next Thread in Perl Forum Timeline: Problem with phonebook -- hash





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC