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?


Try this instead:

export MODULE_DIR=/export/home/modules
  • 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: serverfault.com/questions/64656/… – 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 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.