Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.mel.connect.com.au!news.mira.net.au!vic.news.telstra.net!act.news.telstra.net!psgrain!iafrica.com!pipex-sa.net!plug.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.mathworks.com!nntp.primenet.com!uunet!inXS.uu.net!zdc!zdc-e!szdc-e!news From: gmckinney@megabits.net (Gary N. McKinney) Newsgroups: comp.unix.bsd.bsdi.misc Subject: Re: Script works in shell - not on Web Date: 21 Jul 1996 23:30:06 GMT Organization: Megabits Computers Inc Lines: 51 Message-ID: <4suehv$gt3@perry.zippo.com> References: <4sp14k$6au@sahara.llv.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII X-Newsreader: WinVN 0.99.7 In article <4sp14k$6au@sahara.llv.com>, ross@rossfleege.com says... > >I have a few scripts that run perfectly in shell, but say "Server >Error" when I run them on the web. I chmod'ed them to 755. They >still won't work. They are all in my cgi-bin directory, so they >should execute. The server is Apache and I am running a virtual >domain. Any suggestions? Here's a script I have that works fine in >shell but doesn't work on the Web. > >#!/usr/bin/perl > >print "Content-type: text/html", "\n\n"; > >$username = 'rfleege'; > >print "<HTML>\n <HEAD>\n <TITLE>Finger Me</TITLE>\n </HEAD>\n ><BODY>\n"; > >open(FINGER, "/usr/bin/finger $username |"); > >for(<FINGER>){ > ($word1,$word2,$day,$month,$date,$time) = split(/\s+/,$_); > > if(($word1 eq 'Last')&&($word2 eq 'login')){ > print "I'm currently not online. The last time I was was: \n"; > print "$day $month $date $time\n</BODY>\n </HTML>\n"; > close (FINGER); > exit; > > }elsif(($word1 eq 'On')&&($word2 eq 'since')){ > print "I'm currently on line and have been since: \n"; > print "$day $month $date $time\n </BODY>\n </HTML>\n"; > close (FINGER); > > exit; > } >} > >Ross Fleege >ross@rossfleege.com > Ross ... check the Apache configuration files and make sure you have the CGI scripts activated otherwise the server will not execute the cgi scripts ... also make sure the owner and group for the scripts are set properly ( the default is www for both ). Hope this helps ... PS: when all else fails read the docs..<grin> Gary Mckinney gmckinney@megabits.net Systems administrator & Janitor