【问题标题】:Where is rotatelogs on Ubuntu 16.04? (Upgrade Apache 2.2 to Apache 2.4)Ubuntu 16.04 上的旋转日志在哪里? (将 Apache 2.2 升级到 Apache 2.4)
【发布时间】:2017-02-17 22:00:18
【问题描述】:

在 Ubuntu 16.04 上的 Apache 2.4 上 rotatelogs 的正确路径是什么?

在新的 Ubuntu 16.04 系统上安装了 Apache 2.4,但是当使用与以前的 Ubuntu 12 相同的配置和 Apache 2.2 时,缺少 Apache rotatelogs 程序。

在之前的 2.2 中,路径是 /usr/sbin/rotatelogs

在 Ubuntu 16.04 上安装了 Apache:

sudo apt-get install apache2 apache2-utils

Rotatelogs 似乎记录在 2.4 中。但是 cmets 表示bin/rotatelogs 的路径,但这会导致错误。

错误:

(2)No such file or directory: AH00089: Couldn't start ErrorLog process 'bin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M'. 
AH00015: Unable to open logs

如果配置行有问题:

Apache 2.2(适用于 Ubuntu 12)

ErrorLog "||/usr/sbin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M"

Apache 2.4(两者都不适用于 Ubuntu 16)

ErrorLog "||/usr/sbin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M"

ErrorLog "|bin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M"

【问题讨论】:

    标签: apache ubuntu


    【解决方案1】:

    要查找可执行文件的路径,请使用which

    示例用法which rotatelogs 它应该提供您的路径。我目前是/usr/bin/rotatelogs

    所以ErrorLog 命令应该是

    ErrorLog "|/usr/bin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M"

    【讨论】:

      猜你喜欢
      • 2014-06-16
      • 2015-09-24
      • 2015-10-25
      • 2015-08-31
      • 2020-02-27
      • 2013-12-03
      • 2018-06-25
      • 2017-08-03
      • 2013-09-18
      相关资源
      最近更新 更多