modperl-diabling_mod_perl_for_some_vhosts

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: modperl@apache.org
From: pilsl@goldfisch.at
Subject: disable mod_perl for certain virtual hosts/folders
Date: Mon, 21 Jan 2002 22:06:13 +0100

On my Apache mod_perl is generally enabled with the following statement:

<Directory "/data/apache">
    <Files ~ "\.pl$">
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options +ExecCGI
    </Files>
</Directory>


Now I've couple of pl-files in a certain virtual host that dont run
under mod_perl. How can I disable mod_perl for this virtual host or a certain folder ?

I tried (in the virtual-host config):
 <Files ~ "\.pl$">
        SetHandler cgi-script
        Options +ExecCGI
 </Files>

and even 

 <Files ~ "\.pl$">
        SetHandler default-handler
        Options +ExecCGI
 </Files>


but it didnt work - I have the feeling that I also should specifiy
PerlHandler, but dont know to which value (tried to set it to
'default-handler' but scripts are still running under mod_perl)

any help appretiated,

thnx,
peter

ps: scripts also dont run under PerlRun - they are really badstyled.
===

To: pilsl@goldfisch.at
From: Geoffrey Young <geoff@modperlcookbook.org>
Subject: Re: disable mod_perl for certain virtual
Date: Tue, 22 Jan 2002 08:31:02 -0500

pilsl@goldfisch.at wrote:
> 
> On my Apache mod_perl is generally enabled with the following statement:
> 
> <Directory "/data/apache">
>     <Files ~ "\.pl$">
>         SetHandler perl-script
>         PerlHandler Apache::Registry
>         Options +ExecCGI
>     </Files>
> </Directory>

you might have better luck with something like

<Directory "/data/apache">
  AddHandler .pl perl-script
  PerlHandler Apache::Registry
  Options +ExecCGI
</Directory>

which should work.

===

To: Geoffrey Young <geoff@modperlcookbook.org>
From: pilsl@goldfisch.at
Subject: Re: disable mod_perl for certain virtual
Date: Tue, 22 Jan 2002 14:48:26 +0100

On Tue, Jan 22, 2002 at 08:31:02AM -0500, Geoffrey Young wrote:
> pilsl@goldfisch.at wrote:
> > 
> > On my Apache mod_perl is generally enabled with the following statement:
> > 
> > <Directory "/data/apache">
> >     <Files ~ "\.pl$">
> >         SetHandler perl-script
> >         PerlHandler Apache::Registry
> >         Options +ExecCGI
> >     </Files>
> > </Directory>
> 
> you might have better luck with something like
> 
> <Directory "/data/apache">
>   AddHandler .pl perl-script
>   PerlHandler Apache::Registry
>   Options +ExecCGI
> </Directory>
>


thnx, but: This part doesnt make the problem. mod_perl works like a
charm. Problem is how to deactivate it for a certain location ?

thnx,
peter


===

To: pilsl@goldfisch.at
From: Geoffrey Young <geoff@modperlcookbook.org>
Subject: Re: disable mod_perl for certain virtual
Date: Tue, 22 Jan 2002 08:53:39 -0500

> >
> > <Directory "/data/apache">
> >   AddHandler .pl perl-script
> >   PerlHandler Apache::Registry
> >   Options +ExecCGI
> > </Directory>
> >
> 
> thnx, but: This part doesnt make the problem. mod_perl works like a
> charm. Problem is how to deactivate it for a certain location ?

well, only .pl files will be handled by Apache::Registry under this
config - /data/apache/foo.html ought to be handled by core.

unless you have a global SetHandler perl-script somewhere, mod_perl
should not handle the content-generation phase without being further
specified.

===

To: Geoffrey Young <geoff@modperlcookbook.org>
From: pilsl@goldfisch.at
Subject: Re: disable mod_perl for certain virtual
Date: Tue, 22 Jan 2002 15:02:58 +0100

On Tue, Jan 22, 2002 at 08:53:39AM -0500, Geoffrey Young wrote:
> 
> > >
> > > <Directory "/data/apache">
> > >   AddHandler .pl perl-script
> > >   PerlHandler Apache::Registry
> > >   Options +ExecCGI
> > > </Directory>
> > >
> > 
> > thnx, but: This part doesnt make the problem. mod_perl works like a
> > charm. Problem is how to deactivate it for a certain location ?
> 
> well, only .pl files will be handled by Apache::Registry under this
> config - /data/apache/foo.html ought to be handled by core.
> 
> unless you have a global SetHandler perl-script somewhere, mod_perl
> should not handle the content-generation phase without being further
> specified.
> 


but this is what my config does:

 <Directory "/data/apache">
     <Files ~ "\.pl$">
         SetHandler perl-script
         PerlHandler Apache::Registry
         Options +ExecCGI
     </Files>
 </Directory>


only pl-files are affected. Unfortunately I have some pl-files that
must not run under mod_perl (even not under PerlRun cause they are
really dirty) and I wonder if there is no way to set the orginal
cgi-handler (that does not use mod_perl) for a certain
location/virtual host.
I thought this default-handler is cgi-script, but 

SetHandler cgi-script

in a virtual host does not do the trick.

The only way I've found by now is not to enable mod_perl globally, but
put the above config in each virtual-host section but the one that
contains the mad pl-files.

While this is what I do now, I really wonder I one cant disable
mod_perl ..

thnx,
peter

===

To: modperl@apache.org
From: Thomas Klausner <domm@zsi.at>
Subject: Re: disable mod_perl for certain virtual
Date: Tue, 22 Jan 2002 17:00:13 +0100

Hi!

On Tue, Jan 22, 2002 at 03:02:58PM +0100, pilsl@goldfisch.at wrote:
> only pl-files are affected. Unfortunately I have some pl-files that
> must not run under mod_perl (even not under PerlRun cause they are
> really dirty) and I wonder if there is no way to set the orginal
> cgi-handler (that does not use mod_perl) for a certain
> location/virtual host.
> I thought this default-handler is cgi-script, but 
> 
> SetHandler cgi-script
> 
> in a virtual host does not do the trick.
What about 

<Location /plain-cgi/>
    SetHandler cgi-script
    Options ExecCGI
    allow from all
</Location>
 

===

To: modperl@apache.org
From: Rick Myers <rik@sumthin.nu>
Subject: Re: disable mod_perl for certain virtual
Date: Tue, 22 Jan 2002 18:28:12 -0500

On Jan 22, 2002 at 15:02:58 +0100, pilsl@goldfisch.at wrote:
> 
> On Tue, Jan 22, 2002 at 08:53:39AM -0500, Geoffrey Young wrote:
> > 
> > > >
> > > > <Directory "/data/apache">
> > > >   AddHandler .pl perl-script
> > > >   PerlHandler Apache::Registry
> > > >   Options +ExecCGI
> > > > </Directory>
> > > >
> > > 
> > > thnx, but: This part doesnt make the problem. mod_perl works like a
> > > charm. Problem is how to deactivate it for a certain location ?
> > 
> > well, only .pl files will be handled by Apache::Registry under this
> > config - /data/apache/foo.html ought to be handled by core.
> > 
> > unless you have a global SetHandler perl-script somewhere, mod_perl
> > should not handle the content-generation phase without being further
> > specified.
> > 
> 
> 
> but this is what my config does:
> 
>  <Directory "/data/apache">
>      <Files ~ "\.pl$">
>          SetHandler perl-script
>          PerlHandler Apache::Registry
>          Options +ExecCGI
>      </Files>
>  </Directory>
> 
> 
> only pl-files are affected. Unfortunately I have some pl-files that
> must not run under mod_perl (even not under PerlRun cause they are
> really dirty) and I wonder if there is no way to set the orginal
> cgi-handler (that does not use mod_perl) for a certain
> location/virtual host.
> I thought this default-handler is cgi-script, but 
> 
> SetHandler cgi-script
> 
> in a virtual host does not do the trick.
> 
> The only way I've found by now is not to enable mod_perl globally, but
> put the above config in each virtual-host section but the one that
> contains the mad pl-files.
> 
> While this is what I do now, I really wonder I one can't disable
> mod_perl ..

Actually, you can. But you have to use mod_perl at a higher
level to do it. See this thread for a glimpse of happenings
when I asked a similar question...

  http://mathforum.org/epigone/modperl/kerdspangun/

Eric Cholet volunteered some code privately which did the
trick. It involved using a TransHandler to call
set_handlers(PerlHandler => undef), but only if there was a
PerlSetVar within my Location container.

I tried a similar technique for your problem, but it seems
you can either undef the later handlers or set them as a
code ref -- meaning you can either tell it to use
default-handler or another perl handler. I can't imagine a
way to set it back to cgi-script.

===


To: Rick Myers <rik@sumthin.nu>
From: lesmikesell@attbi.com
Subject: Re: disable mod_perl for certain virtual
Date: Wed, 23 Jan 2002 05:55:43 +0000

> 
> > While this is what I do now, I really wonder I one 
cant disable
> > mod_perl ..
> 
> Actually, you can. But you have to use mod_perl at a 
higher
> level to do it. 

I normally have a front-end proxy and use something
like:
RewriteRule ^path/pattern - [T=application/x-httpd-cgi]
ahead of the rule that proxies the rest to force
execution as a cgi in the front-end httpd.  Won't that
work even if the httpd includes mod_perl?

===

To: pilsl@goldfisch.at, Geoffrey Young
From: Merlin <merlin@camelot.co.pt>
Subject: Re: disable mod_perl for certain virtual
Date: Tue, 22 Jan 2002 13:37:07 +0000

Hi peter,

	If I got, the problem is yours the problem about disabling mod_perl. You can 
do that with somthing like this:

<VirtualHost ...>
...
<Location />
	SetHandler default-handler
</Location>
</VirtualHost>

===



the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu