You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Robert <si...@gmail.com> on 2005/05/23 17:53:57 UTC

mos_perl2 on Windows

I just installed it via PPM (for ActiveStates 5.8.6.811). I had my site 
working under Apache1/CGI without problem.

I upgraded to Apache2/mod_perl and I configured my site conf like so (per 
the docs):

alias /reports "C:\path\to\reports"

PerlModule ModPerl::PerlRun

<Directory "path\to\reports">
      SetHandler perl-script
      PerlResponseHandler ModPerl::PerlRun
      PerlOptions +ParseHeaders
      Options +ExecCGI
</Directory>

My httpd.conf looks like:

#
# MOD_PERL 2.0
#
LoadFile "C:/Perl/bin/perl58.dll"
LoadModule perl_module modules/mod_perl.so
#PerlRequire "C:/Apache2/conf/extra.pl"   <--- this errors out on APR.DLL 
even though it is there...Apache won't start unless I comment this out

Apache starts without errors but I get the following error when trying to 
server up the page:

[Mon May 23 11:46:57 2005] [error] [client 10.149.82.49] Attempt to serve 
directory: C:/path/to/reports/

This is my first "exposure" to mod_perl so maybe it is me?

Robert




Re: mos_perl2 on Windows

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 23 May 2005, Robert wrote:

> On 5/23/05, Randy Kobes <ra...@theoryx5.uwinnipeg.ca> wrote:
[ ... ]
> > Do requests for
> >    http://localhost/reports/some_script_that_does_exist
> > succeed?
>
> It does not:
>
> Apache log:
>
> [Mon May 23 14:05:47 2005] [error] [client 10.149.82.49] Options
> ExecCGI is off in this directory: C:/Documents and Settings/BHicks/My
> Documents/websites/LIVE/reports/test.cgi
>
> 403 Forbidden:
>
> You don't have permission to access /reports/test.cgi on this server.
>
> I do have the "AddHandler cgi-script .cgi" uncommented in the
> httpd.conf and "Options +ExecCGI" is in my site conf.
>
> I am using the example snippet from the perldocs for mod_perl as the
> test script:
>
> my $r = Apache2::RequestUtil->request;
> $r->content_type("text/html");
> $r->send_http_header;
> $r->print("mod_perl rules!");
>
> If I change the conf file to this:
>
>     SetHandler perl-script
>     PerlResponseHandler ModPerl::PerlRun
>     PerlOptions +ParseHeaders
>     Options +ExecCGI
>     Order allow,deny
>     Allow from all
>
> I now get the following error in the Apache2 log file:
>
> [Mon May 23 14:11:37 2005] [error] Can't locate object method
> "send_http_header" via package "Apache2::RequestRec" at (eval 5) line
> 5.\n

send_http_header isn't needed in mod_perl-2:
http://perl.apache.org/docs/2.0/user/porting/compat.html#C__r_E_gt_send_http_header_

You might try the example Registry script and config
directives at
  http://perl.apache.org/docs/2.0/os/win32/config.html#Registry_scripts

-- 
best regards,
randy

Re: mos_perl2 on Windows

Posted by Robert <si...@gmail.com>.
On 5/23/05, Randy Kobes <ra...@theoryx5.uwinnipeg.ca> wrote:
> On Mon, 23 May 2005, Robert wrote:
> 
> > I just installed it via PPM (for ActiveStates 5.8.6.811).
> > I had my site working under Apache1/CGI without problem.
> >
> > I upgraded to Apache2/mod_perl and I configured my site conf like so (per
> > the docs):
> >
> > alias /reports "C:\path\to\reports"
> >
> > PerlModule ModPerl::PerlRun
> >
> > <Directory "path\to\reports">
> >       SetHandler perl-script
> >       PerlResponseHandler ModPerl::PerlRun
> >       PerlOptions +ParseHeaders
> >       Options +ExecCGI
> > </Directory>
> >
> > My httpd.conf looks like:
> >
> > #
> > # MOD_PERL 2.0
> > #
> > LoadFile "C:/Perl/bin/perl58.dll"
> > LoadModule perl_module modules/mod_perl.so
> > #PerlRequire "C:/Apache2/conf/extra.pl"   <--- this errors out on APR.DLL
> > even though it is there...Apache won't start unless I comment this out
> >
> > Apache starts without errors but I get the following error when trying to
> > server up the page:
> >
> > [Mon May 23 11:46:57 2005] [error] [client 10.149.82.49] Attempt to serve
> > directory: C:/path/to/reports/
> 
> I take it this is for a request of
>    http://localhost/reports
> You probably do want Apache to refuse; for security reasons,
> you wouldn't want a user to get a listing of scripts in
> such a directory.
> 
> Do requests for
>    http://localhost/reports/some_script_that_does_exist
> succeed?
> 
> --
> best regards,
> randy kobes
> 
It does not:

Apache log:

[Mon May 23 14:05:47 2005] [error] [client 10.149.82.49] Options
ExecCGI is off in this directory: C:/Documents and Settings/BHicks/My
Documents/websites/LIVE/reports/test.cgi

403 Forbidden:

You don't have permission to access /reports/test.cgi on this server.

I do have the "AddHandler cgi-script .cgi" uncommented in the
httpd.conf and "Options +ExecCGI" is in my site conf.

I am using the example snippet from the perldocs for mod_perl as the
test script:

my $r = Apache2::RequestUtil->request;
$r->content_type("text/html");
$r->send_http_header;
$r->print("mod_perl rules!");

If I change the conf file to this:

    SetHandler perl-script
    PerlResponseHandler ModPerl::PerlRun
    PerlOptions +ParseHeaders
    Options +ExecCGI
    Order allow,deny
    Allow from all

I now get the following error in the Apache2 log file:

[Mon May 23 14:11:37 2005] [error] Can't locate object method
"send_http_header" via package "Apache2::RequestRec" at (eval 5) line
5.\n

Sorry if this is long, and I am so ignorant.  :  \

Robert

Re: mos_perl2 on Windows

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 23 May 2005, Robert wrote:

> I just installed it via PPM (for ActiveStates 5.8.6.811).
> I had my site working under Apache1/CGI without problem.
>
> I upgraded to Apache2/mod_perl and I configured my site conf like so (per
> the docs):
>
> alias /reports "C:\path\to\reports"
>
> PerlModule ModPerl::PerlRun
>
> <Directory "path\to\reports">
>       SetHandler perl-script
>       PerlResponseHandler ModPerl::PerlRun
>       PerlOptions +ParseHeaders
>       Options +ExecCGI
> </Directory>
>
> My httpd.conf looks like:
>
> #
> # MOD_PERL 2.0
> #
> LoadFile "C:/Perl/bin/perl58.dll"
> LoadModule perl_module modules/mod_perl.so
> #PerlRequire "C:/Apache2/conf/extra.pl"   <--- this errors out on APR.DLL
> even though it is there...Apache won't start unless I comment this out
>
> Apache starts without errors but I get the following error when trying to
> server up the page:
>
> [Mon May 23 11:46:57 2005] [error] [client 10.149.82.49] Attempt to serve
> directory: C:/path/to/reports/

I take it this is for a request of
   http://localhost/reports
You probably do want Apache to refuse; for security reasons,
you wouldn't want a user to get a listing of scripts in
such a directory.

Do requests for
   http://localhost/reports/some_script_that_does_exist
succeed?

-- 
best regards,
randy kobes