最近我在我的web服务器上实现了apache 2.4.1。问题是循环日志似乎不起作用。这里是error_log中的输出:
[core:error] [pid 13060:tid 47015847145408] (2)No such file or directory
我已经放在httpd.conf中的命令行如下所示:
CustomLog "|bin/rotatelogs -l /var/log/logfile.%Y.%m.%d 86400" combined
我的设置有什么不对吗?为了您的信息,我已经在apache 2.2.22中testing过了,一切都很完美。
谢谢。
它看起来像你正在运行Apache的用户上下文无权创build/logs
目录中的文件。 您可以通过切换到Apache正在运行的用户( sudo su - <username>
)并正在运行来快速validation
touch /logs/testfile
您的系统上的rotatelogs
二进制文件位于何处?
您的path中没有前导斜杠,这似乎并不是有意的 – 并且找不到文件。 你可能正在寻找更多的东西:
CustomLog "|/bin/rotatelogs -l /var/log/logfile.%Y.%m.%d 86400" combined
使用默认包含的logrotate(如果句号没问题) https://fedorahosted.org/logrotate/