[CentOS] Re: Probably a bad set-up but which one?
schreian at bc.edu
Mon Sep 29 16:11:32 UTC 2008
On Sep 29, 2008, at 11:32 AM, tech wrote:
> > Steve Huff wrote:
>> it would be easier to troubleshoot this problem if you were to
>> post links to the following:
>> * your Perl script
>> * the Apache access and error logs showing what happens when you
>> try to hit the CGI from a browser
>> * the relevant Apache configs (vhost, .htaccess, whatever)
> Thanks for the reply. Instead of links I will post the code as it
> is very short.
> This is what the browser displays all on one line exactly as shown:
> Content-type: text/html Hello, world!
> Here is the index.html file:
> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> <p><!--#exec cmd="perl ./cgi-bin/hello.cgi"--></p>
> Here is the hello.cgi file:
> print "Content-type: text/html\n\n";
> print "Hello, world!\n";
> Here are the lines from the access log:
> 22.214.171.124 - - [29/Sep/2008:23:22:22 +0800] "GET / HTTP/1.1"
> 200 189 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/
> 2008052912 Firefox/3.0"
> The error log has no lines for this access.
I believe your HTML file has already caused the server to emit the
line before it gets to the exec line; so when the perl program prints
that line, it appears in the normal text output instead of as an HTTP
directive. If you want to use the perl program this way, you're
better of using it as a CGI instead of a server include file.
More information about the CentOS