Alois Treindl wrote:
I tried to follow instruction in mod_perl developer's cookbook to move
exitings CGI script to mod_perl.
What happens is that the browser lists the source code of my CGI
scripts, instead of excuting them,
what this means is that the normal Apache handler that sends static content
(such as .html files and images) is serving your pages instead of mod_perl -
a typical problem that usually just boils down to a misconfiguration.
when I create a special mod_perl
directory with this configuration.
PerlModule Apache::PerlRun
Alias /perl/ /www/atl/cm/
PerlTaintCheck on
PerlSetVar Debug 1
Location /perl
SetHandler perl-script
PerlHandler Apache::PerlRun
Options +ExecCGI
PerlSendHeader On
Order deny,allow
Allow from all
/Location
the easiest way to proceed is to do essentially what the other poster said.
I would start by copying your cgi-bin configuration in your http.conf
(namely, the Location container and associated Alias directive) and change
it to perl-bin. then check to see whether a simple script behaves the same
under /cgi-bin/ and under /perl-bin/, for example this env.cgi:
#!/usr/bin/perl
print Content-type: text/plain\n\n;
print map {$_ = $ENV{$_}\n} keys %ENV;
at this point, /perl-bin/env.cgi should show GATEWAY_INTERFACE should be
CGI/1.1, since you're still under mod_cgi.
anyway, after you get your cgi-bin working in the new location, then try to
port the config to mod_perl. first replace
SetHandler cgi-script
with
SetHandler perl-script
PerlHandler Apache::PerlRun
and see what happens - you may have enough to run the scripts under mod_perl
with that step alone. try /perl-bin/env.cgi - under mod_perl,
GATEWAY_INTERFACE is CGI-Perl/1.1 and MOD_PERL is set to something true.
if you're getting errors at this point, check the error_log and try to
resolve any - mod_perl is pretty descriptive most of the time. you may need
to add PerlSendHeader to get your scripts where you want them, but it's not
required for the above basic steps to get a working config.
lemme know if this helps.
--Geoff