Apache error with environment variables (Ubuntu)

大憨熊 提交于 2021-01-27 07:20:32

问题


My OS is Ubuntu 12.04, I have installed separately Apache, Php and Mysql. I've never had a problem, but after an Ubuntu update I always get a "404 Not Found" error when I try to access a php file on my web server.

When I write "apache2 -S" on my console I get this:

[Sat Feb 22 16:15:16.983766 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Sat Feb 22 16:15:16.983871 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Sat Feb 22 16:15:16.983914 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Sat Feb 22 16:15:16.983936 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Sat Feb 22 16:15:16.983966 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Sat Feb 22 16:15:16.987930 2014] [core:warn] [pid 4475:tid 139974428579648] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
[Sat Feb 22 16:15:16.988259 2014] [core:warn] [pid 4475:tid 139974428579648] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Sat Feb 22 16:15:16.988433 2014] [core:warn] [pid 4475:tid 139974428579648] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Sat Feb 22 16:15:16.988456 2014] [core:warn] [pid 4475:tid 139974428579648] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 75 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR} 

Can anyone help me please?


回答1:


from reading this bug page, I surmised that all of these are environment variables that need to be exported before you can run apache2. Apparently these are loaded automatically from /etc/apache2/envvars when you run it as a service like "service apache2 start". Another option is to start it up with apache2ctl.




回答2:


Thats what I get also, when I enter apache2 -S, but everything is working. If you look at apache man page - it is just related to some config parsed data. Do you have any errors from your PHP code ? Take a look at apache log files - they are stored under var/log/apache2 directory.




回答3:


I had a very similar issue running Bugzilla locally via Apache 2.4 on Ubuntu Server 14.04. Running the command sudo /etc/init.d/apache2 graceful got the page to load, where previously Chrome was telling me that no data had been received. I hope someone more knowledgeable than I can explain why this was effective, but service apache2 start and apache2ctl were not.



来源:https://stackoverflow.com/questions/21959888/apache-error-with-environment-variables-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!