You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Chris Brooks <cb...@carescout.com> on 2000/10/19 15:00:10 UTC

Turning off a perl handler in a particular directory

Good morning all,

I have a couple of perl handlers (AccessHandler and Wrapper) running at the document
root of my mod_perl server.  I need to turn one of those handlers off in a lower
level directory, but keep the other one running.

Here's the relevant text from Apache's config file:

<FilesMatch "\.(htm|html|pl)$">
    PerlFixupHandler Carescout::AccessHandler
</FilesMatch>

<Location />
        SetHandler perl-script
        PerlHandler Carescout::Wrapper
        PerlSendHeader On
        Options ExecCGI
</Location>

I tried setting the PerlHandler back to cgi-script (in the lower-level directory),
but that did not turn the Wrapper handler off:
<Location /www/perl/htdocs/lower_level>
        SetHandler cgi-script
        PerlHandler Carescout::AccessHandler
</Location>

Any suggestions on how to do this?

Thanks,
Chris


Re: Turning off a perl handler in a particular directory

Posted by darren chamberlain <da...@boston.com>.
Chris Brooks (cbrooks@carescout.com) said something to this effect:
> You're absolutely right, the mistake is mine.
> 
> I have tried writing the config files a couple of ways:
> 
> <Location /store>
>         SetHandler cgi-script
> </Location>
> 
> and
> 
> <Directory /www/perl/htdocs/store>
>         SetHandler cgi-script
> </Directory>
> 
> I have not had luck in either case turning off the Wrapper handler.
> 
> I did not encounter any errors in restarting the server with the PerlHandler
> Carescout::AccessHandler statement.
> 
> Thoughts?

Looking at p. 444 of the Eagle book seems to indicate that this is right
thing to do (see http://www.modperl.com/book/chapters/ch9.html#item_handler):

# in httpd.conf:

<Perl>
    package Apache::Reset::To::CGIScript;
    use Apache::Constants 'DECLINED';
    
    sub handler {
        shift->handler('cgi-script');
    
        return DECLINED;
    }
</Perl>

<Location /store>
    PerlFixupHandler Apache::Reset::To::CGIScript
</Location>



Good luck.

(darren)

-- 
If only God would give me some clear sign! Like making a large
deposit in my name in a Swiss bank.
    -- Woody Allen

Re: Turning off a perl handler in a particular directory

Posted by Chris Brooks <cb...@carescout.com>.
You're absolutely right, the mistake is mine.

I have tried writing the config files a couple of ways:

<Location /store>
        SetHandler cgi-script
</Location>

and

<Directory /www/perl/htdocs/store>
        SetHandler cgi-script
</Directory>

I have not had luck in either case turning off the Wrapper handler.

I did not encounter any errors in restarting the server with the PerlHandler
Carescout::AccessHandler statement.

Thoughts?

Thanks,
Chris

darren chamberlain wrote:

> Chris Brooks (cbrooks@carescout.com) said something to this effect:
> > I tried setting the PerlHandler back to cgi-script (in the lower-level directory),
> > but that did not turn the Wrapper handler off:
>
> > <Location /www/perl/htdocs/lower_level>
>    ^^^^^^^^
> That should probably be Directory. As written, it will do this for
> http://www.yourdomain.com/www/perl/htdocs/lower_level/ ... Or is that what
> you meant? (I.e., Is this a mistake in your email, your httpd.conf, or
> my assumptions?)
>
> >         SetHandler cgi-script
> >         PerlHandler Carescout::AccessHandler
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This is only relevant when the handler is perl-script. I would have imagined,
> completely without evidence of course, that this would have given you an error
> when Apache parsed the file. (Unless that was supposed to be PerlAccessHandler.)
>
> > </Location>
>
> (darren)
>
> --
> Any technology indistinguishable from magic is insufficiently advanced.

--

Chris Brooks
Director of Technology
CareScout.com
phone: (781) 431-7033 x 342



Re: Turning off a perl handler in a particular directory

Posted by darren chamberlain <da...@boston.com>.
Chris Brooks (cbrooks@carescout.com) said something to this effect:
> I tried setting the PerlHandler back to cgi-script (in the lower-level directory),
> but that did not turn the Wrapper handler off:

> <Location /www/perl/htdocs/lower_level>
   ^^^^^^^^
That should probably be Directory. As written, it will do this for
http://www.yourdomain.com/www/perl/htdocs/lower_level/ ... Or is that what
you meant? (I.e., Is this a mistake in your email, your httpd.conf, or
my assumptions?)

>         SetHandler cgi-script
>         PerlHandler Carescout::AccessHandler
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is only relevant when the handler is perl-script. I would have imagined,
completely without evidence of course, that this would have given you an error
when Apache parsed the file. (Unless that was supposed to be PerlAccessHandler.)

> </Location>

(darren)

-- 
Any technology indistinguishable from magic is insufficiently advanced.