You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Harry Zhu <ha...@GreatLodge.COM> on 2002/07/27 01:53:01 UTC

mod_perl PerlAccessHandler/PerlAuthenHandler question

I'm a verteran CGIer but a new mod-perl user.
I have got the mod-perl running fine for the content handling. But when I
try to step in to other stages like Authentication, and have trouble in
setting
PerlAccessHandler
PerlAuthenHandler
etc.

If I put
###======================
<Location /mpl/hello>
  SetHandler perl-script
  PerlHandler Apache::Hello
</Location>

###======================
in the perl.conf file, it's ok. I got the expected from the browser. But
when I changed above to

###======================
PerlModule Apache::AuthAnon
<Location /mpl/hello>
  AuthName Anonymous
  AuthType Basic
  PerlAuthenHandler Apache::AuthAnon
  require valid-user

  PerlSetVar Anonymous anonymous|anybody

  SetHandler perl-script
  PerlHandler Apache::Hello
</Location>

###======================

and try to restart the server, I got
Syntax error on line 9 of /usr/local/apache/conf/perl.conf:
Invalid command 'PerlAuthenHandler', perhaps mis-spelled or defined by a
module not included in the server configuration


When I set up .htaccess in a directory "test" under DocumentRoot,
###======================
PerlAccessHandler Apache::GateKeeper
PerlSetVar Gate closed

###======================
and try to access this directory, the server gives the "Internal Error":
/usr/local/apache/htdocs/test/.htaccess: Invalid command
'PerlAccessHandler', perhaps mis-spelled or defined by a module not included
in the server configuration

I can add "use Apache::GateKeeper ();" in the startup.pl and start the
server without problem, so the module itself should be in the proper path
for tyhe server to load.

Any help on this will be apprieciated.

Harry
GreatLodge.com





Re: mod_perl PerlAccessHandler/PerlAuthenHandler question

Posted by Steve Piner <st...@marketview.co.nz>.
How is your mod_perl configured? Based on the error message you're
getting, it appears that you may not have compiled in support for
authentication or access control.

If you built it yourself, you may need to add PERL_AUTHEN=1 and
PERL_ACCESS=1 to the 'perl Makefile.PL' command line when building
mod_perl. Unless you have reason not to, I'd recommend that you compile
it with EVERYTHING=1.

Steve Piner


Harry Zhu wrote:
> 
> I'm a verteran CGIer but a new mod-perl user.
> I have got the mod-perl running fine for the content handling. But when I
> try to step in to other stages like Authentication, and have trouble in
> setting
> PerlAccessHandler
> PerlAuthenHandler
> etc.
> 
> If I put
> ###======================
> <Location /mpl/hello>
>   SetHandler perl-script
>   PerlHandler Apache::Hello
> </Location>
> 
> ###======================
> in the perl.conf file, it's ok. I got the expected from the browser. But
> when I changed above to
> 
> ###======================
> PerlModule Apache::AuthAnon
> <Location /mpl/hello>
>   AuthName Anonymous
>   AuthType Basic
>   PerlAuthenHandler Apache::AuthAnon
>   require valid-user
> 
>   PerlSetVar Anonymous anonymous|anybody
> 
>   SetHandler perl-script
>   PerlHandler Apache::Hello
> </Location>
> 
> ###======================
> 
> and try to restart the server, I got
> Syntax error on line 9 of /usr/local/apache/conf/perl.conf:
> Invalid command 'PerlAuthenHandler', perhaps mis-spelled or defined by a
> module not included in the server configuration
> 
> When I set up .htaccess in a directory "test" under DocumentRoot,
> ###======================
> PerlAccessHandler Apache::GateKeeper
> PerlSetVar Gate closed
> 
> ###======================
> and try to access this directory, the server gives the "Internal Error":
> /usr/local/apache/htdocs/test/.htaccess: Invalid command
> 'PerlAccessHandler', perhaps mis-spelled or defined by a module not included
> in the server configuration
> 
> I can add "use Apache::GateKeeper ();" in the startup.pl and start the
> server without problem, so the module itself should be in the proper path
> for tyhe server to load.
> 
> Any help on this will be apprieciated.
> 
> Harry
> GreatLodge.com

-- 
Steve Piner
Web Applications Developer
Marketview Limited
http://www.marketview.co.nz