如何禁用apache2错误日志记录?

时间:2013-03-08 13:25:04

标签: apache2

/etc/apache2/apache2.conf中,我已取消注释以下行:

# ErrorLog ${APACHE_LOG_DIR}/error.log

结果如下:

serv:/var/log/apache2# /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting (2)No such file or directory: apache2: could not open error log file /etc/apache2/logs/error_log.
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
 failed!

如何禁用不包含ErrorLog / CustomLog指令的虚拟主机的错误记录?

2 个答案:

答案 0 :(得分:0)

如您所见,apache无法打开日志文件。在这种情况下,您必须更改

/etc/apache2/apache2.conf

/etc/apache2/${APACHE_LOG_DIR}/error.log

此分辨率可在stating apache ubuntu forum中看到。

答案 1 :(得分:0)

尝试使用以下命令启动apache

service apache2 start