httpd conf环境variables – 它们是如何工作的? (Centos 6)

我有我的httpd.conf中包含以下configuration…

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

其中$ {MODULE_DIR}是我在httpd初始化脚本(/etc/init.d/httpd)中设置的环境variables,如下所示:

 MODULE_DIR=/export/home/modules 

这一行出现在启动httpd的行之前。

现在,当我尝试启动Apache服务器使用…

 /etc/init.d/httpd start 

我仍然得到以下错误:

 [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 [FAILED] [root@MyCentosVM ~]# 

…显然环境variables没有被正确地取代。 我该怎么办?

试试这个:

 export MODULE_DIR=/export/home/modules