From owner-freebsd-questions Tue Oct 22 00:52:08 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA08879 for questions-outgoing; Tue, 22 Oct 1996 00:52:08 -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 AAA08793 for ; Tue, 22 Oct 1996 00:51:59 -0700 (PDT) Received: (from smap@localhost) by gatekeeper.barcode.co.il (8.7.5/8.6.12) id JAA18837; Tue, 22 Oct 1996 09:51:01 +0200 (IST) X-Authentication-Warning: gatekeeper.barcode.co.il: smap set sender to using -f Received: from localhost.barcode.co.il(127.0.0.1) by gatekeeper.barcode.co.il via smap (V1.3) id sma018829; Tue Oct 22 09:50:48 1996 Message-ID: <326C7CAF.1CB7@barcode.co.il> Date: Tue, 22 Oct 1996 09:50:07 +0200 From: Nadav Eiron X-Mailer: Mozilla 3.0 (X11; I; SunOS 5.5 sun4m) MIME-Version: 1.0 To: dwhite@resnet.uoregon.edu CC: questions@FreeBSD.ORG Subject: Re: Apache won't do CGI References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Doug White wrote: > > On Sun, 20 Oct 1996, Nadav Eiron wrote: > > > 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 > > Perhaps there is some problem with your CGI script crashing before it > finishes. Apache picks this up and returns the error. The problem seems to be that it is a script (not a binary). If I use a binary (i.e. a compiled C program) for the script it runs fine, but FreeBSD seems to have trouble with inrterpreted scripts. Even if I run a C program that exec's a shell (or perl) script, the script simply won't start. It seems as if when the interpreter (sh/perl, etc.) gets started it can't find the script it's supposed to run. This really puzzles me. It looks as if Apache does something to break execve/execle, at least as far as interpreted scripts go. > > > Already tried reinstalling, copying the conf directory from the working > > machine, fiddling with security settings etc., to no avail. > > Did you check permissions on the script and other files? Yes. Also, using a compiled program works. See above. Any help will be greatly appreciated. I've already spent a few nights on that :-( > > Doug White | University of Oregon > Internet: dwhite@resnet.uoregon.edu | Residence Networking Assistant > http://gladstone.uoregon.edu/~dwhite | Computer Science Major Nadav