Ubuntu EC2上的Apache2没有读取envvars

我在EC2实例上遇到了Apache2的小问题。 我安装LAMP,但是当我打电话给apache2我收到这个:

 [Thu Dec 03 22:06:56.100599 2015] [core:warn] [pid 31235] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined [Thu Dec 03 22:06:56.100721 2015] [core:warn] [pid 31235] AH00111: Config variable ${APACHE_PID_FILE} is not defined [Thu Dec 03 22:06:56.100777 2015] [core:warn] [pid 31235] AH00111: Config variable ${APACHE_RUN_USER} is not defined [Thu Dec 03 22:06:56.100824 2015] [core:warn] [pid 31235] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined [Thu Dec 03 22:06:56.100871 2015] [core:warn] [pid 31235] AH00111: Config variable ${APACHE_LOG_DIR} is not defined [Thu Dec 03 22:06:56.105835 2015] [core:warn] [pid 31235] AH00111: Config variable ${APACHE_LOG_DIR} is not defined [Thu Dec 03 22:06:56.105971 2015] [core:warn] [pid 31235] AH00111: Config variable ${APACHE_LOG_DIR} is not defined [Thu Dec 03 22:06:56.106008 2015] [core:warn] [pid 31235] AH00111: Config variable ${APACHE_LOG_DIR} is not defined AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf: Invalid Mutex directory in argument file:${APACHE_LOCK_DIR} 

我尝试一切 – apt-get update ,再次安装LAMP,但没有任何工作。 我怎样才能设置这个configurationvariables?

是的,我试图在互联网上find解决scheme,但我不能。

直接从二进制调用Apache不包括使你的错误的envvars。

从init脚本启动,重新启动并停止Apache,或者使用

 $ sudo service apache2 restart 

要么

 $ sudo apachectl restart