[wellylug] Perl scripts not executing in Firefox

John Durham johndurh at spunge.org
Thu Jan 11 13:43:43 NZDT 2007


Jim Cheetham wrote:
> On Thu, Jan 11, 2007 at 11:36:56AM +1300, John Durham wrote:
>   
>> While testing server systems this morning, I found that a perl script 
>> such as this:
>>
>> #!/usr/bin/perl
>>
>> print "Content-type: text/html\n\n";
>> print "Hello, world!\n";
>>
>> exit;
>>
>> This will execute in at the root command prompt, but when invoked in 
>> Firefox, it just lists as plain text. Other scripts respond the same 
>> way. Some insight on this would help get the website functions operational.
>>     
>
> Your webserver (apache) doesn't know that the URL you have asked for is
> supposed to be executed - instead it's treatingit as "just another file
> that has to be returned".
>
> You need to be able to tell apache the difference between normal files,
> and programs.
>
> One way to do this is to put the program into the already-declared CGI
> directory (look for the declaration of "/cgi-bin" in your apache
> configs).
>
> Another way would be to give the script a suffix that you will not use
> for any other type of object, such as "hello.cgi", and then tell apache
> that all files ending with ".cgi" are to be executed. (This is basically
> what you do when you have "index.html" and "image.jpg")
>
> -jim
>
>
>   
The ScriptAlias directive has now been put into http.conf in the apache2 
directory. So far- no change in performance has been noticed. The 
cgi-bin directory has permissions 755. The entry now reads (next line:)
ScriptAlias /cgi-bin/ /home/johndurh/www/modecideas.com/cgi-bin/
-- 
John Durham
Site http://modecideas.com
Good advice is like good paint. It only works when applied.




More information about the wellylug mailing list