Re: Apache showing Perl code

2003-03-06 Thread Gerard ter Haar
Hello B.

From the FAQ:
My CGI/Perl Code Gets Returned as Plain Text Instead of Being Executed by the Webserver

Check your configuration files and make sure that the ExecCGI is turned on in your
configurations.

  Location /perl
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
allow from all
PerlSendHeader On
  /Location

Kind regards

 I just installed Apache and mod_perl, but for some reason when I execute
 scripts through my Apache server it shows all of the Perl code:
 
 #!C:/Perl/bin/Perl.exe
 print Content-type: text/html\n\n;
 
 foreach $var (sort(keys(%ENV))) {
 $val = $ENV{$var};
 $val =~ s|\n|\\n|g;
 $val =~ s||\\|g;
 print ${var}=\${val}\\n;
 }
 
 I got the path found on the first line from an example Perl script
 (printenv.pl) that came with the latest version of the Apache server.
 
 Could anybody give me a hand with a suggestion or two?
 
 




Re: Apache showing Perl code

2003-03-06 Thread Gerard ter Haar
Hello B.

I just reread your question it is MP2. For ModPerl2 there is another answer in the FAQ:

Apache::Registry, Apache::PerlRun and Friends
Apache::Registry, Apache::PerlRun and other modules from the registry family now live 
in
the ModPerl:: namespace to avoid collisions with the versions from 1.0.

To run the Apache::Registry module from mod_perl 1.0 you have to load Apache::compat at
the startup:

  file:startup.pl:
  
  use Apache2; # if you have 1.0 and 2.0 installed
  use Apache::compat ();
  use lib ...; # to find 1.0x Apache::Registry
then in httpd.conf:

  Alias /perl /path/to/perl/scripts
  Location /perl
 Options +ExecCGI
 SetHandler perl-script
 PerlResponseHandler Apache::Registry
  /Location
Notice that Apache::compat has to be loaded before CGI.pm if the latter module is used.

META: complete

META: document that for now ModPerl::Registry doesn't chdir() into the script's dir 
like
Apache::Registry does, because chdir() affects the whole process under threads.

Kind regards,

Gerard ter Haar

 
 From the FAQ:
 My CGI/Perl Code Gets Returned as Plain Text Instead of Being Executed by the 
 Webserver
 
 Check your configuration files and make sure that the ExecCGI is turned on in your
 configurations.
 
   Location /perl
 SetHandler perl-script
 PerlHandler Apache::Registry
 Options ExecCGI
 allow from all
 PerlSendHeader On
   /Location
 
 Kind regards
 
  I just installed Apache and mod_perl, but for some reason when I execute
  scripts through my Apache server it shows all of the Perl code:
  
  #!C:/Perl/bin/Perl.exe
  print Content-type: text/html\n\n;
  
  foreach $var (sort(keys(%ENV))) {
  $val = $ENV{$var};
  $val =~ s|\n|\\n|g;
  $val =~ s||\\|g;
  print ${var}=\${val}\\n;
  }
  
  I got the path found on the first line from an example Perl script
  (printenv.pl) that came with the latest version of the Apache server.
  
  Could anybody give me a hand with a suggestion or two?