Re: Cgi help - malformed header from script. Bad header
On Tue, Sep 30, 2003 at 07:01:21AM -0500, 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 1Jimmy 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? you need a blank line after the content-type header: #!/bin/sh echo Content-type: text/plain echo /usr/bin/calendar - rob ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
RE: Cgi help - malformed header from script. Bad header
put another echo after the first one. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rob Ellis Sent: Tuesday, September 30, 2003 9:21 AM To: Charles Howse Cc: [EMAIL PROTECTED] Subject: Re: Cgi help - malformed header from script. Bad header On Tue, Sep 30, 2003 at 07:01:21AM -0500, 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? you need a blank line after the content-type header: #!/bin/sh echo Content-type: text/plain echo /usr/bin/calendar - rob ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebs d-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Cgi help - malformed header from script. Bad header
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 1Jimmy 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 [EMAIL PROTECTED] and help make history! http://setiathome.ssl.berkeley.edu/ ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] -- Andreas Kohn [EMAIL PROTECTED] signature.asc Description: This is a digitally signed message part
RE: Cgi help - malformed header from script. Bad header
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. Hoooray! It works now! Thanks to all who responded. NOW...take a look at http://howse.no-ip.org And then look at http://howse.no-ip.org/cgi-bin/cal Where is the documentation on how to get the calendar info into a web page that looks like my default? ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
SOLVED RE: Cgi help - malformed header from script. Bad header
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 1Jimmy 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. Hoooray! It works now! Thanks to all who responded. NOW...take a look at http://howse.no-ip.org And then look at http://howse.no-ip.org/cgi-bin/cal Where is the documentation on how to get the calendar info into a web page that looks like my default? I'll post the details if anyone's interested, just wanted to let the list know there is no need for further replies to this thread. :-) ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]