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
MohammedSimba
  • 184
  • 1
  • 1
  • 9

2 Answers2

0

Did you check permission on the /var/log/apache2 directory?

$ ls -l /var/log/
drwxr-x--- 2 root      adm        4096 Apr 12 06:55 apache2
5kKate
  • 61
  • 5
0

I Found the issue was because the apache2 daemon file under /etc/init.d was "some how" erased!!, I replaced that file from backup and it is logging normally now.

MohammedSimba
  • 184
  • 1
  • 1
  • 9