From owner-freebsd-questions Sun Oct 20 09:56:10 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA01422 for questions-outgoing; Sun, 20 Oct 1996 09:56:10 -0700 (PDT) Received: from gatekeeper.barcode.co.il (gatekeeper.barcode.co.il [192.116.93.17]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id JAA01417 for ; Sun, 20 Oct 1996 09:56:06 -0700 (PDT) Received: from scully.barcode.co.il (localhost.barcode.co.il [127.0.0.1]) by gatekeeper.barcode.co.il (8.7.5/8.6.12) with SMTP id SAA13782 for ; Sun, 20 Oct 1996 18:55:59 +0200 (IST) Message-ID: <326A598B.41C67EA6@barcode.co.il> Date: Sun, 20 Oct 1996 18:55:39 +0200 From: Nadav Eiron X-Mailer: Mozilla 3.0 (X11; I; FreeBSD 2.1.5-RELEASE i386) MIME-Version: 1.0 Newsgroups: comp.infosystems.www.servers.unix CC: questions@freebsd.org Subject: Apache won't do CGI Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi! I'm running Apache 1.1.1 on two FreeBSD 2.1.5 Release mahines. One works Just Fine, the other will not run any CGI scripts. When I attempt to run a CGI script I get: /usr/local/apache/cgi-bin/test-cgi: Can't open /usr/local/apache/cgi-bin/test-cgi [Sun Oct 20 17:51:18 1996] access to /usr/local/apache/cgi-bin/test-cgi failed for scully.barcode.co.il, reason: Premature end of script headers Working through mod_cgi.c with gdb I got to the following (possibly incorrect :->) conclusions: 1. The child process that should run the script gets spawned O.K. The exec that should execute the script works too (at least it doesn't return). 2. The fgets that the server does to get the output on the script's stdout returnd NULL. 3. Even if I put printf's in the code before the exec, giving output on stdout beforethe script gets exec'ed, the parent doesn't seem to read it. I'm sure it's something trivial (I have a similar configuration working) just don't know what it is. It looks as if the pipe between the parent and child is broken (but the pipe() call does not return any errors). Thanks for any advice anyone might have for me. Nadav P.S. Already tried reinstalling, copying the conf directory from the working machine, fiddling with security settings etc., to no avail.