On one server, where I have a custom directory where all the Apache (httpd) error and access logs are written, one set per virtualhost, I noticed the folder had grown to multiple gigabytes in size (found using
du -h --max-depth=1)—in this situation, there's a handy utility on pretty much every Linux/UNIX system called logrotate that is made to help ensure log files don't grow too large. It periodically copies and optionally compresses the log files and deletes old logs, daily, monthly, or on other schedules.
For this server, to quickly fix the problem of growing-too-large log files, I added a file 'httpd-custom' at
/etc/logrotate.d/httpd-custom, with the following contents:
rotate 5<br />
size 25M<br />
/sbin/service httpd reload > /dev/null 2>/dev/null || true<br />