Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2001 20:58:14 -0700
From:      Cherie&John Carri <cjcarri@earthlink.net>
To:        questions@FreeBSD.org
Cc:        cjcarri@earthlink.net
Subject:   One CGI script won't run - permission problemss??
Message-ID:  <3.0.6.32.20011016205814.007ab100@earthlink.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.6.32.20011016205814.007ab100>