From owner-freebsd-questions Tue Oct 16 22:41:40 2001 Delivered-To: freebsd-questions@freebsd.org Received: from gatekeeper.ph.inter.net (team.ph.inter.net [203.176.75.3]) by hub.freebsd.org (Postfix) with ESMTP id 5016137B405 for ; Tue, 16 Oct 2001 22:41:35 -0700 (PDT) Received: from portalone (unknown [192.168.88.228]) by gatekeeper.ph.inter.net (Postfix) with SMTP id 3245A43DFF for ; Wed, 17 Oct 2001 13:41:34 +0800 (PHT) Message-ID: <004b01c156ce$cd7f2c80$e458a8c0@ph.inter.net> From: "louie miranda" To: References: <3.0.6.32.20011016205814.007ab100@earthlink.net> Subject: Re: One CGI script won't run - permission problemss?? Date: Wed, 17 Oct 2001 13:44:35 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 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, i have encounter that problem before.. what i did is i recode it again but in my UNIX machine.. when, i transfer my file win to unix / when i run it, the apache error logs says, not/found. so what i did is i run it on the console ./myperl not/found again.. so i ask on irc, and they told me to copy n paste it to win to unix, not in ftp binary/ascii and then i did run it again and it work.. hope this help.. louie miranda (axishift.ath.cx) ------------------------------------------ Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :) ----- Original Message ----- From: "Cherie&John Carri" To: Cc: Sent: Wednesday, October 17, 2001 11:58 AM Subject: One CGI script won't run - permission problemss?? > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message