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-Programming/Running-Perl-CGI-scripts...

http://www.ftponline.com/javapro/2003_03/online/perl_teden_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 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-Programming/Running-Perl-CGI-scripts...

http://www.ftponline.com/javapro/2003_03/online/perl_teden_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.

Hi Katharnakh,

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

Thanx
/Parani.

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.