• Debian 11 has reached its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.81 is the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

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