logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Issue in passing environmental variables in Apache 2.4
Author
abcd



Joined: 06 Aug 2015
Posts: 1
Location: India

PostPosted: Mon 10 Aug '15 13:24    Post subject: Issue in passing environmental variables in Apache 2.4 Reply with quote

I have installed Apache2.4 version but i am not able to pass the environment variables to my application which was working fine in Apache version 1.3.9 , i have googled a lot and after many trials its still not working.

The module mod_env.c is loaded and the syntax is
PassEnv BUILD_HOST
This env variable is passed through the cgi script which is called by my application.

When i am starting the apache its throwing error:

[Thu Aug 06 14:40:13.740194 2015] [env:warn] [pid 4864:tid 288] AH01506: PassEnv
variable BUILD_HOST was undefined

Somebody please help!!
Back to top
jraute



Joined: 13 Sep 2013
Posts: 188
Location: Rheinland, Germany

PostPosted: Mon 10 Aug '15 14:15    Post subject: Re: Issue in passing environmental variables in Apache 2.4 Reply with quote

Hello abcd,

it's not throwing an error it's just a warning.
Besides this if you define a variable with PassEnv then you have to set something to fill it.
That is the missing part at the start.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 10 Aug '15 22:06    Post subject: Reply with quote

Do I see confusion between PassEnv (the variable has to already exist in the OS) and SetEnv where you create the variable and give it value?
Back to top
jraute



Joined: 13 Sep 2013
Posts: 188
Location: Rheinland, Germany

PostPosted: Wed 12 Aug '15 8:32    Post subject: Reply with quote

glsmith wrote:
Do I see confusion between PassEnv (the variable has to already exist in the OS) and SetEnv where you create the variable and give it value?


Not a confusion, but a misunderstanding. Embarassed
You are right.
Anyway what would be the solution?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 12 Aug '15 9:52    Post subject: Reply with quote

Well, if BUILD_HOST does not already exist in Windows [1] (you set it in there manually or some other way) then you cannot pass an environment variable that does not exist.

I just tested it knowing full well I do not have BUILD_HOST in my Windows environment and this is what I get;

[Wed Aug 12 00:27:29.553800 2015] [env:warn] [pid 3072:tid 612] AH01506: PassEnv variable BUILD_HOST
was undefined

So, I think what was actually used in the OPs 1.3.9 (wow is that old) was SetEnv or they were running Win98 when there were not separate user/system environments. Or they are trying to pass a user land envvar [2]

SetEnv BUILD_HOST "some value"

[1] The environment variables in Windows like PATH and COMSPEC can be found in
control panel -> system -> {advanced system settings ->} advanced tab -> environment variables button.

Depending on the version of Windows the {} stuff is not there (begining in Vista, extra steps = better productivity) Rolling Eyes

[2] There is user and system variables. Only the system variables can be passed when Apache is running as a service.
Back to top
jraute



Joined: 13 Sep 2013
Posts: 188
Location: Rheinland, Germany

PostPosted: Wed 12 Aug '15 15:57    Post subject: Reply with quote

Good to know, thanks, but then i was not that wrong Wink
Back to top


Reply to topic   Topic: Issue in passing environmental variables in Apache 2.4 View previous topic :: View next topic
Post new topic   Forum Index -> Apache