From owner-freebsd-questions Sun Mar 16 9:31:46 2003 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 30D3537B404 for ; Sun, 16 Mar 2003 09:31:44 -0800 (PST) Received: from naboo.blacktrap.net (212.68.218.22.brutele.be [212.68.218.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3061543F75 for ; Sun, 16 Mar 2003 09:31:42 -0800 (PST) (envelope-from olinether@blacktrap.net) Received: from naboo.blacktrap.net (localhost [127.0.0.1]) by naboo.blacktrap.net (8.12.3/8.12.3) with ESMTP id h2GHZ2Lc005308; Sun, 16 Mar 2003 18:35:02 +0100 (CET) (envelope-from olinether@naboo.blacktrap.net) Received: (from olinether@localhost) by naboo.blacktrap.net (8.12.3/8.12.3/Submit) id h2GHZ1KG005307; Sun, 16 Mar 2003 18:35:01 +0100 (CET) Date: Sun, 16 Mar 2003 18:35:00 +0100 From: Olivier Dony To: FreeBSD-Questions Subject: mod_cgi not working at all/weird behaviour Message-ID: <20030316183500.A5276@naboo.blacktrap.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, I posted a problem some days ago about POST data not being passed to my cgi perl scripts. This only happens on my FreeBSD4.7-RELEASE server. Well in the process of troubleshooting I noticed that if I disabled mod_gzip (which is the only thing I don't have on my other working servers) my scripts stopped working completely with error 500. I tried then to reinstall everything. So I deinstalled perl, apache and what depends on it, deleted apache's conf file and reinstalled everything *but mod_gzip*. Well my cgi's aren't working a bit more than before! Anything I put in a cgi script ends with an internal error 500, and in the errorlog it always says : [Fri Mar 14 00:18:19 2003] [error] [client 212.68.212.45] Premature end of script headers: /home/oli/public_html/cgi-bin/test.cgi *Anything*, meaning that it fails too with a basic script like this : --- #!/bin/sh echo "content-type: text/html" echo " hello" --- (the empty line after content-type is there) My scripts are done by hand using vim, so no binary ftp xfer involved. All the scripts are chmod'd 0755, the containing directory too, and they give the expected output when run in the console. This is with apache 1.3.27_4 from the ports, mod_php4 4.3.1, and perl base or perl 5.6.1_11 from the ports (same result). I've tried doing tests to output this basic thing with sh, perl, php, etc.. everything gives the same 500 error when executed through CGI, while working ok in the console!! And guess what, if I reinstall mod_gzip, as soon as it is enabled and set to handle cgi-script with (mod_gzip_item_include mime ^text/html and mod_gzip_item_include handler ^cgi-script$) the scripts start to work, ie they give the expected output, but the first problem comes back : POST data is always empty. So I had to change my scripts to use GET for submitting forms, which is ugly and might even trigger query-string length problems I suppose. I'm completely lost, this doesn't seem to make sense at all, but is probably making sense if I knew where to look... The rest of the webserver is doing fine, basic html files and php are working ok, even with POST data! How could mod_gzip make my cgi scripts work, but only partly, and how come they aren't working at all without it, when working ok on my other FreeBSD webservers ?? Could someone help me or advice me before I completely lose my poor mind? ;-) I've tried to reinstall everything, change permissions etc.. Always the same result... Thanks a lot in advance if someone can provide any sort of help! Olivier To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message