Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help: Apache: cgi script - malformed header from script

827 views
Skip to first unread message

Alistair

unread,
Sep 23, 1999, 3:00:00 AM9/23/99
to
Trying to get simple cgi to work...

I've written a simple shell script to output some basic html, but when I run
it I get this error message in the error log:

malformed header from script. Bad header=<HTML>

I've looked in the FAQ and it's helpful in the sense that it states:
"the server was expecting a complete set of HTTP headers (one or more followed
by a blank line), and didn't get them."

Unfortunately, I don't know what an http header is or looks like, and the
Apache documentation isn't helpful in this respect. My shell script simply
wrties to stdout:

<html>
<title> a title </title>
<body>
some text
</body>
</html>

Also...

I've added a "ScriptLog logs/cgi_log" entry to the httpd.conf file, but there's
no output there (yes I've restarted the server). I've even touched the file so
that it exists (with the same permissions as the other log files) but no joy.

Please send replies to directly to aba...@bigfoot.com, as my mail reader
crashes when I open this newsgroup.

Alistair.


Kevin J. Dyer

unread,
Sep 23, 1999, 3:00:00 AM9/23/99
to
On Thu, 23 Sep 1999 20:31:07 +0100, Alistair <aba...@bigfoot.com>
wrote:

>Trying to get simple cgi to work...
>
>I've written a simple shell script to output some basic html, but when I run
>it I get this error message in the error log:
>
> malformed header from script. Bad header=<HTML>
>
>I've looked in the FAQ and it's helpful in the sense that it states:
>"the server was expecting a complete set of HTTP headers (one or more followed
>by a blank line), and didn't get them."
>
>Unfortunately, I don't know what an http header is or looks like, and the
>Apache documentation isn't helpful in this respect. My shell script simply
>wrties to stdout:


Your script is missing a Content-Type:
>
You need to add at least one line that outputs.

echo "Content-Type: text/html\n\n"

0 new messages