You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Dan Baker <da...@dtbakerprojects.com> on 2002/02/28 05:14:00 UTC

how to disable mod_perl in a subdir?

I am working with a host that has everything under /cgi-bin running
mod_perl by default, and well as using EmbPerl to run the dynamic pages.
Unfortunately, I have a set of scripts that really need "regular" perl,
and I can't seem to figure out the configuration to  disable mod_perl in
a specific directory that needs
regular perl. ;( 

I tried this in the httpd.conf file:
<Directory /home/mydomain/cgi-bin/webadmin/>
  SetHandler default-handler
  AddHandler cgi-script .pl
  AllowOverride All
</Directory> 

and then ALSO editted a .htaccess file in
/home/mydomain/cgi-bin/webadmin/ to include:
  options +ExecCGI
  RemoveHandler perl-script
  SetHandler cgi-script 
  AddHandler cgi-script .pl

and it still tries to use mod_perl?!

SERVER_SOFTWARE = Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1
OpenSSL/0.9.6 mod_perl/1.24_01 

PLEASE let me know if there is a way to configure so that a specific
sub-dir uses regular perl.

Dan

Re: how to disable mod_perl in a subdir?

Posted by Marc Slagle <ma...@securelevel.com>.
>From the perldocs:

     This module's handler emulates the CGI environment, allowing
     programmers to write scripts that run under CGI or mod_perl
     without change.  Unlike Apache::Registry, the
     Apache::PerlRun handler does not cache the script inside of
     a subroutine.  Scripts will be "compiled" every request.
     After the script has run, it's namespace is flushed of all
     variables and subroutines.

     The Apache::Registry handler is much faster than
     Apache::PerlRun.  However, Apache::PerlRun is much faster
     than CGI as the fork is still avoided and scripts can use
     modules which have been pre-loaded at server startup time.
     This module is meant for "Dirty" CGI Perl scripts which
     relied on the single request lifetime of CGI and cannot run
     under Apache::Registry without cleanup.

----- Original Message -----
From: "Dan Baker" <da...@dtbakerprojects.com>
To: <mo...@apache.org>
Sent: Thursday, February 28, 2002 7:49 AM
Subject: Re: how to disable mod_perl in a subdir?


> the host has that commented out for some reason:
>   Alias /cgi-bin/ /home/seniordiscounts/cgi-bin/
>   <Location /cgi-bin>
>     SetHandler perl-script
>     #PerlHandler Apache::PerlRun
>     PerlHandler Apache::Registry
>     Options +ExecCGI
>   </Location>
>
> please explain how PerlRun might be better?
> -------------------
>
> Marc Slagle wrote:
> >
> > Maybe you can try Apache::PerlRun instead of Apache::Registry for the
> > directories that you need to run those scripts.  The perldocs show how
to
> > set it up.
> >
> > Marc Slagle
> >
> > ----- Original Message -----
> > From: "Dan Baker" <da...@dtbakerprojects.com>
> > To: <mo...@apache.org>
> > Sent: Wednesday, February 27, 2002 11:14 PM
> > Subject: how to disable mod_perl in a subdir?
> >
> > > I am working with a host that has everything under /cgi-bin running
> > > mod_perl by default, and well as using EmbPerl to run the dynamic
pages.
> > > Unfortunately, I have a set of scripts that really need "regular"
perl,
> > > and I can't seem to figure out the configuration to  disable mod_perl
in
> > > a specific directory that needs
> > > regular perl. ;(
> > >
> > > I tried this in the httpd.conf file:
> > > <Directory /home/mydomain/cgi-bin/webadmin/>
> > >   SetHandler default-handler
> > >   AddHandler cgi-script .pl
> > >   AllowOverride All
> > > </Directory>
> > >
> > > and then ALSO editted a .htaccess file in
> > > /home/mydomain/cgi-bin/webadmin/ to include:
> > >   options +ExecCGI
> > >   RemoveHandler perl-script
> > >   SetHandler cgi-script
> > >   AddHandler cgi-script .pl
> > >
> > > and it still tries to use mod_perl?!
> > >
> > > SERVER_SOFTWARE = Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1
> > > OpenSSL/0.9.6 mod_perl/1.24_01
> > >
> > > PLEASE let me know if there is a way to configure so that a specific
> > > sub-dir uses regular perl.
> > >
> > > Dan
> > >
>


Re: how to disable mod_perl in a subdir?

Posted by Dan Baker <da...@dtbakerprojects.com>.
the host has that commented out for some reason:
  Alias /cgi-bin/ /home/seniordiscounts/cgi-bin/
  <Location /cgi-bin>
    SetHandler perl-script
    #PerlHandler Apache::PerlRun
    PerlHandler Apache::Registry
    Options +ExecCGI
  </Location>

please explain how PerlRun might be better?
-------------------

Marc Slagle wrote:
> 
> Maybe you can try Apache::PerlRun instead of Apache::Registry for the
> directories that you need to run those scripts.  The perldocs show how to
> set it up.
> 
> Marc Slagle
> 
> ----- Original Message -----
> From: "Dan Baker" <da...@dtbakerprojects.com>
> To: <mo...@apache.org>
> Sent: Wednesday, February 27, 2002 11:14 PM
> Subject: how to disable mod_perl in a subdir?
> 
> > I am working with a host that has everything under /cgi-bin running
> > mod_perl by default, and well as using EmbPerl to run the dynamic pages.
> > Unfortunately, I have a set of scripts that really need "regular" perl,
> > and I can't seem to figure out the configuration to  disable mod_perl in
> > a specific directory that needs
> > regular perl. ;(
> >
> > I tried this in the httpd.conf file:
> > <Directory /home/mydomain/cgi-bin/webadmin/>
> >   SetHandler default-handler
> >   AddHandler cgi-script .pl
> >   AllowOverride All
> > </Directory>
> >
> > and then ALSO editted a .htaccess file in
> > /home/mydomain/cgi-bin/webadmin/ to include:
> >   options +ExecCGI
> >   RemoveHandler perl-script
> >   SetHandler cgi-script
> >   AddHandler cgi-script .pl
> >
> > and it still tries to use mod_perl?!
> >
> > SERVER_SOFTWARE = Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1
> > OpenSSL/0.9.6 mod_perl/1.24_01
> >
> > PLEASE let me know if there is a way to configure so that a specific
> > sub-dir uses regular perl.
> >
> > Dan
> >

Re: how to disable mod_perl in a subdir?

Posted by Marc Slagle <ma...@securelevel.com>.
Maybe you can try Apache::PerlRun instead of Apache::Registry for the
directories that you need to run those scripts.  The perldocs show how to
set it up.

Marc Slagle

----- Original Message -----
From: "Dan Baker" <da...@dtbakerprojects.com>
To: <mo...@apache.org>
Sent: Wednesday, February 27, 2002 11:14 PM
Subject: how to disable mod_perl in a subdir?


> I am working with a host that has everything under /cgi-bin running
> mod_perl by default, and well as using EmbPerl to run the dynamic pages.
> Unfortunately, I have a set of scripts that really need "regular" perl,
> and I can't seem to figure out the configuration to  disable mod_perl in
> a specific directory that needs
> regular perl. ;(
>
> I tried this in the httpd.conf file:
> <Directory /home/mydomain/cgi-bin/webadmin/>
>   SetHandler default-handler
>   AddHandler cgi-script .pl
>   AllowOverride All
> </Directory>
>
> and then ALSO editted a .htaccess file in
> /home/mydomain/cgi-bin/webadmin/ to include:
>   options +ExecCGI
>   RemoveHandler perl-script
>   SetHandler cgi-script
>   AddHandler cgi-script .pl
>
> and it still tries to use mod_perl?!
>
> SERVER_SOFTWARE = Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1
> OpenSSL/0.9.6 mod_perl/1.24_01
>
> PLEASE let me know if there is a way to configure so that a specific
> sub-dir uses regular perl.
>
> Dan
>


Re: how to disable mod_perl in a subdir? Directory vs Location

Posted by Rick Myers <ri...@sumthin.nu>.
On Feb 28, 2002 at 05:54:07 -0700, Dan Baker wrote:
> 
> Rick Myers wrote:
> > 
> > On Feb 27, 2002 at 21:14:00 -0700, Dan Baker wrote:
> > >
> > > I am working with a host that has everything under /cgi-bin running
> > > mod_perl by default, and well as using EmbPerl to run the dynamic pages.
> > 
> > This begs the question, how are they doing that?
> > 
> > I mean, if they're using Location's or File's then you're
> > going to have to bend to their whim since those override
> > Directory's.
> > 
> --------------------------------------
> 
> hhmmm, so if they have set up in httpd.conf:
> 
>   Alias /cgi-bin/ /home/seniordiscounts/cgi-bin/
>   <Location /cgi-bin>
>     SetHandler perl-script
>     #PerlHandler Apache::PerlRun
>     PerlHandler Apache::Registry
>     Options +ExecCGI
>   </Location>
> 
> then the non mod_perl section:
> 
> <Directory /home/seniordiscounts/cgi-bin/webadmin/>
>   SetHandler default-handler
>   AddHandler cgi-script .pl
>   AllowOverride All
> </Directory> 
> 
> will be overidden?

Right. At least that's how I read the relevant doc...

   http://httpd.apache.org/docs/sections.html

> I guess then I should add an alias line and switch to
> using Location ?

That would work, but see the above doc. Location's are
processed in the order they appear in the conf file.

--rick


Re: how to disable mod_perl in a subdir? Directory vs Location

Posted by Dan Baker <da...@dtbakerprojects.com>.

Rick Myers wrote:
> 
> On Feb 27, 2002 at 21:14:00 -0700, Dan Baker wrote:
> >
> > I am working with a host that has everything under /cgi-bin running
> > mod_perl by default, and well as using EmbPerl to run the dynamic pages.
> 
> This begs the question, how are they doing that?
> 
> I mean, if they're using Location's or File's then you're
> going to have to bend to their whim since those override
> Directory's.
> 
--------------------------------------

hhmmm, so if they have set up in httpd.conf:

  Alias /cgi-bin/ /home/seniordiscounts/cgi-bin/
  <Location /cgi-bin>
    SetHandler perl-script
    #PerlHandler Apache::PerlRun
    PerlHandler Apache::Registry
    Options +ExecCGI
  </Location>

then the non mod_perl section:

<Directory /home/seniordiscounts/cgi-bin/webadmin/>
  SetHandler default-handler
  AddHandler cgi-script .pl
  AllowOverride All
</Directory> 

will be overidden? I guess then I should add an alias line and switch to
using Location ?

Dan