From owner-freebsd-questions Tue Oct 22 03:40:07 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id DAA21412 for questions-outgoing; Tue, 22 Oct 1996 03:40:07 -0700 (PDT) Received: from iworks.InterWorks.org (deischen@iworks.interworks.org [128.255.18.10]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id DAA21404 for ; Tue, 22 Oct 1996 03:40:03 -0700 (PDT) Received: by iworks.InterWorks.org (1.37.109.8/16.2) id AA01739; Tue, 22 Oct 1996 05:39:37 -0500 Message-Id: <9610221039.AA01739@iworks.InterWorks.org> Date: Tue, 22 Oct 1996 05:39:37 -0500 From: "Daniel M. Eischen" To: dwhite@resnet.uoregon.edu, nadav@barcode.co.il, questions@freebsd.org Subject: Re: Apache won't do CGI Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > /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 :-( I just set up an internal Web server at work using FreeBSD 2.1.5 and apache-1.1.1. That same CGI test script worked just fine when I tried it from within a form. One thing that did screw me up for a while with some other scripts was a mis-type in "Content-type text/plain". I forgot the "-" in Content-type. Is the script executable? What happens when you say "perl test-cgi" (it is a perl script, right?) from the command line. Dan Eischen deischen@iworks.InterWorks.org