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 the following config included in my httpd.conf...

Include ${MODULE_DIR}/utilities/devconf/bo/vhost.conf

where ${MODULE_DIR} is an environment variable that I am setting in my httpd init script (/etc/init.d/httpd) like so:


this line appears before the line that launches httpd.

Now when I attempt to start the Apache server using...

/etc/init.d/httpd start

I still get the following error:

[root@MyCentosVM ~]# /etc/init.d/httpd start
Starting httpd: httpd: Syntax error on line 1011 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf/devconf-vhosts.conf: Could not open configuration file /etc/httpd/${MODULE_DIR}/utilities/devconf/bo/vhost.conf: No such file or directory
[root@MyCentosVM ~]#

... clearly the environment variable is not being substituted correctly. What do I do?

share|improve this question
up vote 4 down vote accepted

Try this instead:

export MODULE_DIR=/export/home/modules
share|improve this answer
Thanks for your response, however I don't think I am. The method I'm using is described in the answer by markdrayton in this post:… – Xoundboy Sep 1 '11 at 13:43
I've updated my answer. – quanta Sep 1 '11 at 14:17
I just found the answer and came back to post it but found that you beat me to it :) Thanks – Xoundboy Sep 1 '11 at 14:35

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.