【问题标题】:How can I disable apache2 error logging?如何禁用 apache2 错误日志记录?
【发布时间】:2013-03-08 13:25:03
【问题描述】:

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

【问题讨论】:

  • 听起来像是serverfault.com的问题
  • 只需 touch /etc/apache2/logs/error_log 就可以了。如果您不想要日志记录,为什么首先取消注释 apache.conf 中的 ErrorLog 指令?

标签: apache2


【解决方案1】:

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

/etc/apache2/apache2.conf

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

这个分辨率可以在stating apache ubuntu forum看到。

【讨论】:

    【解决方案2】:

    尝试使用以下命令启动 apache

    service apache2 start
    

    【讨论】:

      猜你喜欢
      • 2017-10-02
      • 2012-09-26
      • 1970-01-01
      • 2011-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多