Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Ubuntu 12.04 LTS server with a vanilla apache install. In my Apache Config, I'm using PassEnv to pass an environment variable:


MY_VARIABLE is defined in /etc/environment:


If I stop and start apache, the variable is picked up and all is well. However, after reboot, apache does not pick up MY_VARIABLE.

Does Apache start before variables in /etc/environment are set? Is there some other way to accomplish what I'm trying to do?

share|improve this question

That is weird ! You can try a cheat by sourcing /etc/environment in /etc/init/d/httpd (not recommended on all occasions)

1) A straight forward solution will be a custom script to launch your apache with your own configuration , you can do all the housekeeping jobs in the script , please use -f to specify your custom httpd.conf file.

2) Alternative : use setEnv to set the required environment variable from httpd.conf itself.

3) Alternative , try to export the required variables from .bashrc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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