[wellylug] Perl scripts not executing in Firefox
Cliff Pratt
enkidu at cliffp.com
Thu Jan 11 19:34:59 NZDT 2007
John Durham wrote:
> Phillip Hutchings wrote:
>>> It is in the cgi-bin of the web server, and the page was loaded into the
>>> browser by opening the page file directly from the server.
>>
>> Then your server isn't executing cgi scripts
>>
>>> If perl isn't
>>> a client side scripting language, then why did the script execute at the
>>> command prompt and not in the browser? Both were used in the same
>>> system.
>>
>> I think there's confusion on client- vs server-side scripting.
>>
>> JavaScript is (normally) a client-side scripting language, the server
>> sends the script unaltered to the browser, and the browser then
>> executes the script. JavaScript is the only client-side language worth
>> speaking of.
>>
>> Perl, Python, Ruby and almost every other language has to be used for
>> server-side execution. Here the script is executed by the web server
>> and the output of the script is sent to the browser. The browser never
>> sees the code. It worked from the command line because that's how the
>> webserver executes it (to oversimplify somewhat), but not in the
>> webbrowser because the browser has no clue what perl is.
>>
>> Things to check:
>> That Apache either has:
>> ScriptAlias /path/to/cgi-scripts /cgi-bin
>> OR
>> <Location /cgi-bin>
>> Options +ExecCGI
>> AddHandler cgi-script .cgi
>> </Location>
>>
>> in the appropriate virtual host.
>>
> By the appropriate virtual host do you mean the web browser or page
> environment? Is that second option to be included in the configuration
> files of the website itself rather than the server?
>
In the /etc/apache2 directory there is a file called httpd.conf. This is
the old historical name. There is also a file called apache.conf. This
contains the new conf file which defines the 'global' parameters that
apply to all sites in the apache configuration. At the end you will see
an 'include' statement which reference /etc/apache2/sites-enabled. These
are the individual sites in the configuration. To see all your sites, at
the command line type 'apache2ctl -S'. For each site there will be a
link in /etc/apache2/sites-enabled tp the site definition in
/etc/apache2/sites-available.
So you should make site changes to the files in
/etc/apache2/sites-available and general changes to the
/etc/apache2/apache.conf
IN the above "Location" definition, I believe the line should read:
AddHandler cgi-script .cgi .pl
Cheers,
Cliff
More information about the wellylug
mailing list