You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Wayne Pascoe <wa...@penguinpowered.org.uk> on 2001/04/20 22:59:24 UTC

How to tell if scripts are mod_perl ?

Hi there,

I'm trying to roll out some software by one of our 3rd party
developers. I'm trying to find out if the scripts will actually be run
through mod_perl and not as cgi's. 

The only config changes that they have specified to my Apache config
is as follows :

Alias /cgi-bin/  /real/path/to/perl-scripts/

<Location /cgi-bin>
        SetHandler  perl-script
        PerlHandler Apache::Registry
        Options +ExecCGI
</Location>

They have not requested any settings like 
PerlWarn On
PerlTaintCheck On

There are also no use statements being required (eg use
Apache::Registry() ) in the config. 

Is there any way to check that the scripts are being run through
mod_perl and not as cgi's ? 

Thanks,

-- 
--Wayne--
The time for action is passed.              | wayne@penguinpowered.org.uk
Now is the time for sensless                | www.penguinpowered.org.uk
bickering.                                  |

Re: How to tell if scripts are mod_perl ?

Posted by Chris Reinhardt <ct...@dyndns.org>.
You can check the MOD_PERL envirement variable.  Something like:

	if ($ENV{MOD_PERL}) {
		# We're under mod_perl
	} else {
		# strait perl here
	}



-- 
Chris Reinhardt
ctriv@dyndns.org
Webmaster
Dynamic DNS Network Services
http://www.dyndns.org/
On 20 Apr 2001, Wayne Pascoe wrote:

> Hi there,
>
> I'm trying to roll out some software by one of our 3rd party
> developers. I'm trying to find out if the scripts will actually be run
> through mod_perl and not as cgi's.
>
> The only config changes that they have specified to my Apache config
> is as follows :
>
> Alias /cgi-bin/  /real/path/to/perl-scripts/
>
> <Location /cgi-bin>
>         SetHandler  perl-script
>         PerlHandler Apache::Registry
>         Options +ExecCGI
> </Location>
>
> They have not requested any settings like
> PerlWarn On
> PerlTaintCheck On
>
> There are also no use statements being required (eg use
> Apache::Registry() ) in the config.
>
> Is there any way to check that the scripts are being run through
> mod_perl and not as cgi's ?
>
> Thanks,
>
> --
> --Wayne--
> The time for action is passed.              | wayne@penguinpowered.org.uk
> Now is the time for sensless                | www.penguinpowered.org.uk
> bickering.                                  |
>


Re: How to tell if scripts are mod_perl ?

Posted by "Sean C. Brady" <se...@valueclick.com>.
On 20 Apr 2001, Wayne Pascoe wrote:

> Hi there,
> 
> I'm trying to roll out some software by one of our 3rd party
> developers. I'm trying to find out if the scripts will actually be run
> through mod_perl and not as cgi's. 
> 
> The only config changes that they have specified to my Apache config
> is as follows :
> 
> Alias /cgi-bin/  /real/path/to/perl-scripts/

Looks like mod_perl to me
 
> <Location /cgi-bin>
>         SetHandler  perl-script <- This right here tells Apache to use
mod_perl for scripts in /cgi-bin, which is really
/real/path/to/perl-scripts/

>         PerlHandler Apache::Registry <- And this tells mod_perl to use
Apache::Registry as the handler for scripts located in /cgi-bin

>         Options +ExecCGI
> </Location>


> 
> They have not requested any settings like 
> PerlWarn On
> PerlTaintCheck On
> 


> There are also no use statements being required (eg use
> Apache::Registry() ) in the config. 
> 
You're not seeing anything in the config file that says use
Apache::Registry because it's being stated in the bit above...


> Is there any way to check that the scripts are being run through
> mod_perl and not as cgi's ? 
> 
> Thanks,
> 
> 

Hope that helps,
Sean


Re: How to tell if scripts are mod_perl ?

Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi there,

On 20 Apr 2001, Wayne Pascoe wrote:

> I'm trying to find out if the scripts will actually be run
> through mod_perl and not as cgi's. 

http://perl.apache.org/guide

73,
Ged.