From owner-freebsd-questions Tue Oct 16 20:51:57 2001 Delivered-To: freebsd-questions@freebsd.org Received: from scaup.mail.pas.earthlink.net (scaup.mail.pas.earthlink.net [207.217.121.49]) by hub.freebsd.org (Postfix) with ESMTP id 2632037B40A for ; Tue, 16 Oct 2001 20:51:55 -0700 (PDT) Received: from frodo (pool0189.cvx27-bradley.dialup.earthlink.net [209.179.56.189]) by scaup.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id UAA27313; Tue, 16 Oct 2001 20:51:50 -0700 (PDT) Message-Id: <3.0.6.32.20011016205814.007ab100@earthlink.net> X-Sender: cjcarri@earthlink.net X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Tue, 16 Oct 2001 20:58:14 -0700 To: questions@FreeBSD.org From: Cherie&John Carri Subject: One CGI script won't run - permission problemss?? Cc: cjcarri@earthlink.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 Hi all, I have a 200 MHz Pentium PC running FreeBSD 4.2. It's set up with Apache and Perl, for use as a web server on a small intranet at work. I have several Perl scripts in the cgi-bin directory, but ONE of them won't work as it should, and I've run out of ideas to try. Here are the details: 1)All the CGI scripts have temporarily been set with chmod a+x 2)All the CGI scripts have the identical #!/usr/bin/perl first line 3)All the CGI scripts run without errors when I execute them directly with Perl ("perl scriptname") in the /cgi-bin directory However, ONE script, nutest1.pl, won't run when the browser calls it. The browser (Netscape 4.x, came with my FreeBSD 4.2 set) shows "500 internal server error" in the top status bar, and "The server encountered an internal error or misconfiguration and was unable to complete your request" in the main window. I checked /var/log/httpd-error.log, and found the messages "No such file or directory: exec of /usr/local/www/cgi-bin/nutest1.pl failed" and "Premature end of script headers usr/local/www/cgi-bin/nutest1.pl" For the record, "ls -l /usr/local/www/cgi-bin" shows lrwxr-xr-x as the permissions for this directory. Okay, Apache can't find or run this file, but WHY? It's in the same directory as the other scripts that do work, the permissions are set the same as the other scripts (to -rwxr-xr-x), and I can run it directly with Perl with no errors. What could possibly be wrong here? The only thing different about this one script that won't run is that: (A)It was developed on a Windows machine (where it ran fine!), and was then ported over to my FreeBSD box by changing the shebang line to #!/usr/bin/perl, the location of Perl on the FreeBSD box. (B)It opens a file and reads in data during execution. The data file has temporarily been set to permissions -rwxrwxrwx, but I don't think this is my problem as the script in question doesn't even start. Any ideas? I keep wondering if there is still some setting with file permissions in FreeBSD that I am unaware of. Any and all help appreciated. I'm trying to get this script to work by tomorrow, so it might be a long night! TIA, -John Carri To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message