You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Gordon Stewart <go...@gordonstewart.co.uk> on 2005/10/10 12:20:09 UTC

enviroment Vars

Dear List 

I am new to mod perI.

I have set up a virtual web server and it rely on enviroment variables.  When I restart my apache server only 3 enviroment variables are set.  When I logon using the apache user over 20 enviroment vars are set. where have my enviorment variables gone.

Thanks

Gordon Stewart
 

Re: enviroment Vars

Posted by Pratik <pr...@gmail.com>.
Hi Gordon,

Have a look at http://perl.apache.org/docs/2.0/user/config/config.html#C_SetupEnv_

It's always a good idea to turn that option off and use Perl Apache
API instead of CGI.

You will need to do "PerlPassEnv" for each env variable that you set
in your outside Apache environment, for them to be available under
Apache.

For example,

$ setenv Hello "World"
$ httpd -f ~/local.conf

Now if you want to use $ENV{"Hello"} under Apache, you will need to
have following line in your apache configuration file ( local.conf
here ) :

PerlPassEnv Hello

Thanks,
Pratik

On 10/10/05, Gordon Stewart <go...@gordonstewart.co.uk> wrote:
>
> Dear List
>
> I am new to mod perI.
>
> I have set up a virtual web server and it rely on enviroment variables.
> When I restart my apache server only 3 enviroment variables are set.  When I
> logon using the apache user over 20 enviroment vars are set. where have my
> enviorment variables gone.
>
> Thanks
>
> Gordon Stewart
>


--
http://www.rails.info - Coming Soon !

Re: enviroment Vars

Posted by Risanecek <ri...@gmail.com>.
On 10/10/05, Gordon Stewart <go...@gordonstewart.co.uk> wrote:
>
>
> I am new to mod perI.
>  I have set up a virtual web server and it rely on enviroment variables.
> When I restart my apache server only 3 enviroment variables are set. When I
> logon using the apache user over 20 enviroment vars are set. where have my
> enviorment variables gone.
>

Please have a look at the

SetEnv

directive.

SetEnv <variable name> value

lets you set values for environment variables in your apache config (also in
virtualhost).