1

My ubuntu server, few days ago the access.log and error.log files created under /var/log/apache2, but they still empty, Currently apache is logging into access.log.1 and error.log.1, this issue is happening for all the virtual hosts on my server. all permision are normally "rw-r--r--" and owner root:adm under the /var/log/apache2

here is my /etc/logrotate.d/apache2 "we didn't change it"

/var/log/apache2/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 644 root adm
sharedscripts
postrotate
        if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
                /etc/init.d/apache2 reload > /dev/null
        fi
endscript
4

2 回答 2

0

您是否检查了 /var/log/apache2 目录的权限?

$ ls -l /var/log/
drwxr-x--- 2 root      adm        4096 Apr 12 06:55 apache2
于 2015-05-08T02:14:17.557 回答
0

我发现问题是因为 /etc/init.d 下的 apache2 守护程序文件被“以某种方式”删除了!!,我从备份中替换了该文件,现在它正在正常记录。

于 2015-05-08T16:30:17.657 回答