Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2003 14:23:48 +0200
From:      Andreas Kohn <andreas.kohn@gmx.net>
To:        Charles Howse <chowse@charter.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Cgi help - malformed header from script. Bad header
Message-ID:  <1064924628.669.5.camel@klamath>
In-Reply-To: <005301c3874a$93fc9700$04fea8c0@moe>
References:  <005301c3874a$93fc9700$04fea8c0@moe>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Tue, 2003-09-30 at 14:01, Charles Howse wrote:
> Hi,
> FBSD 4.8-RELEASE-p10, Apache2.
> 
> My first cgi-bin program.
> I have the following files in /usr/local/www/cgi-bin:
> Cal (-rwxr-xr-x)
> Calendar (-rw-r--r-- typical calendar file to display 'today in
> history')
> 
> Cal contains the following lines:
> #!/bin/sh
> echo Content-type: text/plain
> /usr/bin/calendar
> ------
> If I cd to /usr/loca/www/cgi-bin, and do ./cal,
> I get the echo, plus the expected output.
> 
> When I request, http://howse.no-ip.org/cgi-bin/cal
> I get an Internal Server Error.
> The error logfile says:
> Malformed header from script. Bad header=Oct 1	Jimmy Carter born,
> 192,:cal
> 
> ScriptAlias is defined properly in httpd.conf, and I get the proper
> output from test-cgi.
> 
> I've read the Apache2 documentation on CGI, and troubleshooting errors,
> no joy.
> 
> How can I fix this?
> 
> 
Hi, 

Header and content of the HTTP response have to be separated by an empty
line.

#!/bin/sh
echo Content-type: text/plain
echo ""
/usr/bin/calendar

should work.

> Thanks,
> Charles
> 
> Got a computer with idle CPU time?
> Join SETI@home and help make history!
> http://setiathome.ssl.berkeley.edu/
> 
> 
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
-- 
Andreas Kohn <andreas.kohn@gmx.net>

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQA/eXXUYucd7Ow1ygwRAjKxAJ9kXraTjU842k7kA4ISM0fWr9Ev/gCgkn3k
FIZ765XKYrknMcDDuDu+zU0=
=7/8w
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1064924628.669.5.camel>