Hi,

Apache requires CGI scripts to generate their own Content-type headers. Try

#!/usr/bin/perl
print "Content-type: text/plain\n\nHello";

This should work.

Best
Sascha

----- Original Message ----- From: "Tom Cat" <[EMAIL PROTECTED]>
To: <users@httpd.apache.org>
Sent: Tuesday, February 21, 2006 3:12 PM
Subject: [EMAIL PROTECTED] Premature end of script headers


All of my perl scripts generate this error when I try to have Apache
serve them.  I'm on RHEL with Apache 2.0.52.

The simplest script I have is:
#!/usr/bin/perl
print "Hello";

In the error log I'm told:
[Tue Feb 21 08:57:48 2006] [error] [client 10.33.1.32] Premature end
of script headers: hello.cgi

I've tried changing LogLevel from warn to debug and still only get this message.

In httpd.conf, I load cgi_module (mod_cgi.so) at the beginning as well
as suexec_module (mod_suexec.so).

I also set the following:
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
   AllowOverride None
   # Options None
   Options ExecCGI
   Order allow,deny
   Allow from all
</Directory>

in /var/www, when I do ls -lh I get
drwxr-xr-x  2 root      root 4.0K Feb 21 08:53 cgi-bin

in /var/www/cgi-bin, when I do ls -l I get
-rwxr-xr-x  1 apache apache 32 Feb 20 16:01 hello.cgi

I have tried changing the owner and group of hello.cgi It was at first
both root and I changed it to apache (which is what httpd runs as).

I've tried changing the location of the cgi-bin directory.  I've tried
to change the name of the file to just hello (dropping the cgi
extension).  I've changed permissions on both the file and the cgi-bin
directory (when I do that, it will sometimes complain in suexec.log
that something is writable by others).  I've tried not loading suexec,
but that doesn't change the result.

I don't know what to do at this point.  What should I try next?

Thanks in advance,

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to