From owner-freebsd-questions@FreeBSD.ORG Tue Sep 30 05:20:45 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43C9F16A4B3 for ; Tue, 30 Sep 2003 05:20:45 -0700 (PDT) Received: from post.web.ca (post.web.ca [192.139.37.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E9AA44011 for ; Tue, 30 Sep 2003 05:20:44 -0700 (PDT) (envelope-from rob@web.ca) Received: by post.web.ca (Postfix, from userid 1001) id 6FB5B6278; Tue, 30 Sep 2003 08:20:43 -0400 (EDT) Date: Tue, 30 Sep 2003 08:20:43 -0400 From: Rob Ellis To: Charles Howse Message-ID: <20030930122043.GA4771@web.ca> Mail-Followup-To: Rob Ellis , Charles Howse , freebsd-questions@freebsd.org References: <005301c3874a$93fc9700$04fea8c0@moe> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <005301c3874a$93fc9700$04fea8c0@moe> User-Agent: Mutt/1.4.1i cc: freebsd-questions@freebsd.org Subject: Re: Cgi help - malformed header from script. Bad header X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 12:20:45 -0000 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