0

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:

PassEnv MY_VARIABLE

MY_VARIABLE is defined in /etc/environment:

MY_VARIABLE=true

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?

djvg
  • 137
  • 7
lmanners
  • 101
  • 2

1 Answers1

0

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.