Re: Handler without handler()

2001-03-13 Thread Mike Cameron

I believe that you need to load your module first, either in a startup file or
with PerlModule Me::MyHandler

Gene Dascher wrote:

> I have a handler that I want to contain all of my methods for access
> control, authentication and authorization.  I have created the file with 3
> different methods named access($$), authentication($$) and
> authorization($$).  I have these methods set up thusly in the httpd.conf
> file:
>
> 
> PerlHandler Apache::Registry
> AuthType Me::MyHandler
> AuthName Me
> PerlAccessHandler Me::MyHandler->access
> PerlAuthenHandler Me::MyHandler->authenticate
> PerlAuthzHandler Me::MyHandler->authorize
> PerlInitHandler Apache::StatINC
> PerlSetVar StatINCDebug On
> require valid-user
> 
>
> Unfortunately, every time I try and access a cgi in that directory, I get
> the following errors:
>
> Can't locate object method "access" via package "Me::MyHandler"
> access.pm: Can't locate access.pm in @INC
>
> So I have a couple of questions:
> 1) Can I write a handler that doesn't have a method named 'handler'?
> 2) If so, what do I have to put in the httpd.conf file to allow Apache to
> properly access the handler methods?
>
> Thanks,
>
> Gene Dascher




Re: Handler without handler()

2001-03-13 Thread Sean C. Brady

Gene Dascher wrote:
> 
> I have a handler that I want to contain all of my methods for access
> control, authentication and authorization.  I have created the file with 3
> different methods named access($$), authentication($$) and
> authorization($$).  I have these methods set up thusly in the httpd.conf
> file:
> 
> 
> PerlHandler Apache::Registry
> AuthType Me::MyHandler
> AuthName Me
> PerlAccessHandler Me::MyHandler->access
> PerlAuthenHandler Me::MyHandler->authenticate
> PerlAuthzHandler Me::MyHandler->authorize
> PerlInitHandler Apache::StatINC
> PerlSetVar StatINCDebug On
> require valid-user
> 
> 
> Unfortunately, every time I try and access a cgi in that directory, I get
> the following errors:
> 
> Can't locate object method "access" via package "Me::MyHandler"
> access.pm: Can't locate access.pm in @INC
> 
> So I have a couple of questions:

> 1) Can I write a handler that doesn't have a method named 'handler'?

Yes, you can write a handler that doesn't have a sub named 'handler'.

> 2) If so, what do I have to put in the httpd.conf file to allow Apache to
> properly access the handler methods?

I believe you need to specify the subroutine.  Otherwise the handler sub
is assumed.

> 
> Thanks,
> 
> Gene Dascher

~Sean



Handler without handler()

2001-03-13 Thread Gene Dascher

I have a handler that I want to contain all of my methods for access
control, authentication and authorization.  I have created the file with 3
different methods named access($$), authentication($$) and
authorization($$).  I have these methods set up thusly in the httpd.conf
file:


PerlHandler Apache::Registry
AuthType Me::MyHandler
AuthName Me
PerlAccessHandler Me::MyHandler->access
PerlAuthenHandler Me::MyHandler->authenticate
PerlAuthzHandler Me::MyHandler->authorize
PerlInitHandler Apache::StatINC
PerlSetVar StatINCDebug On
require valid-user


Unfortunately, every time I try and access a cgi in that directory, I get
the following errors:

Can't locate object method "access" via package "Me::MyHandler"
access.pm: Can't locate access.pm in @INC

So I have a couple of questions:
1) Can I write a handler that doesn't have a method named 'handler'?
2) If so, what do I have to put in the httpd.conf file to allow Apache to
properly access the handler methods?

Thanks,

Gene Dascher