Author Topic: Apache log file too large  (Read 4206 times)

0 Members and 1 Guest are viewing this topic.

Apache log file too large
« on: April 25, 2021, 01:12:03 AM »
I found that the apache log file is too large, how to clear the log? how to make the apache log save a file every day by date?


I changed suphp_log to suphp_log-, and then changed it to suphp_log. Now the modification time of suphp_log has not changed for a long time, indicating that the system no longer uses suphp_log. How do I fix it?
« Last Edit: April 25, 2021, 01:22:47 AM by gailclark80 »

Re: Apache log file too large
« Reply #1 on: April 25, 2021, 12:34:41 PM »
setup logorotate for dom logs and apache logs

/usr/local/apache/domlogs/*.log   /usr/local/apache/logs/*.log  /usr/local/apache/logs/*_log  {
    rotate 30
    create 640 root adm
   /bin/kill -HUP `cat /usr/local/apache/logs/ 2>/dev/null` 2> /dev/null || true
        /bin/kill -USR1 `cat /run/ 2>/dev/null` 2>/dev/null || true

thiis will make smaler flies that you can remove after you dont need - keeping last 20-30 days if needed

Re: Apache log file too large
« Reply #2 on: March 07, 2022, 10:46:50 PM »
Hi all,
I noticed that by deleting the logs in "/usr/local/apache/domlogs/", the statistics application "goaccess" does not show the statistics.
My question is: is there a way to clear these logs without goaccess stopping working?
for example awstats reads the logs every night, and the rotate doesn't bother him and I wanted to understand if there was the possibility of doing the same thing with goaccess as well.

I don't want to leave too large logs on the system without being able to rotate them, but I also don't want an application like goaccess to stop working.

Does anyone have a solution?