• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

How to rotate /var/log/httpd/access_log ?

A

AlterEgo

Guest
Can someone explain me how i can rotate the access_log in /var/log/httpd/access_log ? It's realy huge (about 5 gig a day) and i realy don't need it !

Thanks!
 
create /etc/logrotate.d/httpd with the following. If will likely fail on that 5 gig log though. If you dont need it, I would stop apache, delete it, and restart apache.
/var/log/httpd/*log {
missingok
notifempty
daily
rotate 5
compress
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
 
Thanks, wil first try a new httpd... i think your 2nd solution will not work because it will recreate access_log automatic.
 
That's what it is supposed to do. Apache will not run without the access_log. It is defined in your httpd.conf.
 
You can always empty it with an hourly cron with somehting like

0 * * * * /bin/echo "" > /path/to/access_log

(may need to use \"\" cant remember)


seems strange for that log to be getting so large daily if its already set on rotation
 
Wow, if his site is that busy, I wanna visit it too!!! lol
 
Originally posted by mikk
You can always empty it with an hourly cron with somehting like

0 * * * * /bin/echo "" > /path/to/access_log

(may need to use \"\" cant remember)


seems strange for that log to be getting so large daily if its already set on rotation

Thanks that's also a good solution!
 
Originally posted by jamesyeeoc
Wow, if his site is that busy, I wanna visit it too!!! lol

Please send me a private message if you want to visit this site ! ;)
 
Back
Top