Apache logs empty

| November 1, 2011 | 0 Comments

Empty Apache Logs:

One morning you find that your apache logs files are empty. These are be many reasons for that like:

  • No permission to write logs
  • Ready only file system.
  • Directory path is not write.

But all these are fine and everything starts working again, you see entries in apache logs, once you restart apache, but this stops again after a day or 2.Reason can be nightly logrorate: Usually found at /etc/logrorate.d/http

 var/log/httpd/*log {
daily
missingok
compress
notifempty
dateext
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null | true
endscript
}

Check where is the pid file for apache. What happens is that during logroate, “/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null | true” fails cause system does not find the pid file. Update the line with the right apache pid location and that should fix the problem with your apache logs.



  • Digg
  • Facebook
  • Twitter
  • Google Bookmarks
  • LinkedIn
  • RSS

No related posts.

Category: Linux, Software

Leave a Reply

*