You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Joseph Crotty <jc...@matchlogic.com> on 2001/02/02 19:56:09 UTC

ServerRoot/Block Directive question...

Hi all,

I have an Apache::GateKeeper that checks to see if the user has logged in
and been served a cookie... if not they are redirected to index.html(to
login).  I want all comers to ServerRoot/cgi-bin or ServerRoot/perl to have
to go thru the GateKeeper handler, except those trying to get to login.cgi
which lives in ServerRoot/perl.  I was trying to use the perl.conf Block
Directives below, but am not getting the negated <Files !~> line to work
right.  I snooped around on the mail archives but can't find anything about
negated regex matching.

PerlRequire             conf/startup.pl
PerlFreshRestart        On
PerlSetEnv              MOD_PERL_TRACE all

#Directory Handlers
#------------------
<Directory /perl>
        AllowOverride   None
        Options         +ExecCGI
        SetHandler      perl-script
        PerlHandler     Apache::Registry
        PerlSendHeader  On
</Directory>

<Directory ~ (cgi-bin|perl)>
        <Files !~ "login.cgi">
                PerlAccessHandler       Apache::GateKeeper
                ErrorDocument           403 /index.html
        </Files>
</Directory>

Thanks,

Joe Crotty

Re: ServerRoot/Block Directive question...

Posted by Christian Gilmore <cg...@corp.tivoli.com>.
There is no negation of an entire regex in apache's configuration. You
have to do something like this:

<DirectoryMatch		"^(cgi-bin|perl)$">
PerlAccessHandler	Apache::GateKeeper
ErrorDocument 403	/index.html

<Files			"login.cgi">
PerlAccessHandler	Apache::OK
</Files>
</DirectoryMatch>

Regards,
Christian

On Fri, 2 Feb 2001, Joseph Crotty wrote:

> Hi all,
> 
> I have an Apache::GateKeeper that checks to see if the user has logged in
> and been served a cookie... if not they are redirected to index.html(to
> login).  I want all comers to ServerRoot/cgi-bin or ServerRoot/perl to have
> to go thru the GateKeeper handler, except those trying to get to login.cgi
> which lives in ServerRoot/perl.  I was trying to use the perl.conf Block
> Directives below, but am not getting the negated <Files !~> line to work
> right.  I snooped around on the mail archives but can't find anything about
> negated regex matching.
> 
> PerlRequire             conf/startup.pl
> PerlFreshRestart        On
> PerlSetEnv              MOD_PERL_TRACE all
> 
> #Directory Handlers
> #------------------
> <Directory /perl>
>         AllowOverride   None
>         Options         +ExecCGI
>         SetHandler      perl-script
>         PerlHandler     Apache::Registry
>         PerlSendHeader  On
> </Directory>
> 
> <Directory ~ (cgi-bin|perl)>
>         <Files !~ "login.cgi">
>                 PerlAccessHandler       Apache::GateKeeper
>                 ErrorDocument           403 /index.html
>         </Files>
> </Directory>
> 
> Thanks,
> 
> Joe Crotty
>