You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Wladimir Boton <wb...@hotmail.com> on 2003/03/07 14:43:50 UTC
Re: shtml don´t get parsed with mod_perlprotecting the directory
Thank you, it works!
my conf file has the following:
<location "/auth" >
Options +IncludesNOEXEC
SetHandler perl-script
PerlAccessHandler Apache::handlers::authentication
PerlFixupHandler Apache::handlers::shtmlFixupHandler
</Location>
and I create the file shtmlFixupHandler.pm with the following content:
#file begin
package Apache::handlers::shtmlFixupHandler;
use Apache::Constants qw(:common);
sub handler {
my $request = instance Apache::Request(shift);
$request->handler('server-parsed') if $request->filename =~ m/\.shtml$/;
return OK;
}
#file end
And it work fine.
When I tried to acces a page in the protected directory, for exemple,
http://mysite.com/auth/index.shtml, it ask me my credentials and then parse
the file correctly.
thank you.
Wladimir
>From: simran <si...@reflectit.com>
>To: Wladimir Boton <wb...@hotmail.com>
>CC: modperl@perl.apache.org
>Subject: Re: shtml don´t get parsed with mod_perlprotecting the directory
>Date: 07 Mar 2003 11:29:18 +1100
>
>You have to install a fixup handler to tell the server to parse them
>again, i have the following in my config file:
>
>-- in httpd.conf --
>PerlFixupHandler +NetChant::Component::Handlers::shtmlFixupHandler
>
>and my shtmlFixupHandler subroutine looks like:
>
>####################################
>#
># shtmlFixupHandler
>#
>
>=head2 shtmlFixupHandler
>
>=over
>
>=item Description
>
>Enables you to have shtml files in areas where you might have other
>PerlHandlers installed.
>
>ie. Assuming you have the Includes option turned on for your virtual
>host/server, putting a
> .shtml file in the 'auth' directory will not work as expected (aka, it
>will not get parsed).
> This is because there is a PerlHandler already installed in that
>location which has an
> associated "SetHandler perl-script" directive, and that directive
>takes precedence over
> all others.
>
> To enable .shtml files to work in the /auth location for a virtual
>host put the following
> configuration in your virtual host apache config file.
>
> <Location /auth>
> Options +IncludesNOEXEC
> SetHandler perl-script
> PerlFixupHandler +NetChant::Component::Handlers::shtmlFixupHandler
> </Location>
>
>=back
>
>=cut
>
>sub shtmlFixupHandler {
> my $request = instance Apache::Request(shift);
>
> #
> #
> #
> $request->handler('server-parsed') if $request->filename =~
>m/\.shtml$/;
>
> #
> #
> #
> return OK;
>}
>
>
>
>
>
>
>On Fri, 2003-03-07 at 11:12, Wladimir Boton wrote:
> > Hi,
> >
> > I´m protecting a directory of my site with mod_perl, but all .shtml
>files
> > inside it don´t get parsed by mod_include.
> >
> > There are any way that shtml files get parsed?
> >
> > thanks
> >
> >
> >
> > _________________________________________________________________
> > MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.com
_________________________________________________________________
MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.com