-1

I'm running apache on my Debian 8 laptop. I haven't made any config changes so everything is at the default.

apache2.conf uses environment variable defined in /etc/apache2/envvars, but when I open a shell on my laptop and run printenv I don't see any of those variables defined in envvars.

Are they running in a different context or something? Why can't I see them?

The apache docs regarding apache environment vars make no mention of envvars so I'm assuming the variables defined there are operating system env vars and are not an apache specific mechanism.

4

Are they running in a different context or something?

Yes.

Env vars are not global constants that apply to any process running on a machine. A file containing some env files isn't automatically loaded; Assuming apache uses the file, those env vars are only relevant to when apache is in use, i.e. a http context.

If you want them to be loaded in a shell you need to load them yourself, i.e.:

$ source /etc/apache2/envvars
$ env # show everything
  • OK. Also, just so I understand, in the doc I linked to they say Apache also has its own "environmental variables" and that are not the same as OS environment variables. The variables in envvars are OS environment variables and not the internal ones apache uses right? – red888 Jun 5 '16 at 16:38
  • the docs for SetEnvIf may clarify for you. The docs are talking about variables used when evaluating your rules (such as object_is_image). – AD7six Jun 5 '16 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.