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

如何禁用apache2错误日志记录?,apache2,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 /et

/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指令的虚拟主机的错误日志记录?

正如您所看到的,apache无法打开日志文件。在这种情况下,你必须改变

/etc/apache2/apache2.conf


此解决方案可以在中看到。

尝试使用以下命令启动apache

service apache2 start

听起来像是一个简单的
touch/etc/apache2/logs/error\u log
问题,你应该没事。如果不需要日志记录,为什么首先要取消apache.conf中的ErrorLog指令的注释?
service apache2 start