title: How to use environment variables in apache vhost
body: <p>I have a environment variable called <code>DISTANT_APP_ADDR</code>:</p>
  
  <pre><code>$ echo $DISTANT_APP_ADDR
  $ 172.17.0.102
  </code></pre>
  
  <p>I want to use this variable in my vhost, so I've added in the <code>/etc/apache2/envvars</code> file :</p>
  
  <pre><code>export DISTANT_APP_ADDR=${DISTANT_APP_ADDR}
  </code></pre>
  
  <p>In my vhost :</p>
  
  <pre><code>FastCgiExternalServer /var/www/cgi-bin/php5.external -host ${DISTANT_APP_ADDR}:9000
  </code></pre>
  
  <p>But when I restart apache, I've the error :</p>
  
  <pre><code>$ service apache2 restart
  $ FastCgiExternalServer /var/www/cgi-bin/php5.external: failed to resolve "" to exactly one IP address
  </code></pre>
  
  <p>By replacing <code>${DISTANT_APP_ADDR}</code> in the envvars file with the real value it's working.</p>
  
  <p>I've also to to put a <code>PassEnv DISTANT_APP_ADDR</code> in my vhost file, but the result is the same.</p>
  
  <p>How can I pass my env vars to my vhost file ?</p>