Author Topic: CWP Apache domlogs cover 50% of my disk  (Read 262 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
CWP Apache domlogs cover 50% of my disk
« on: January 20, 2023, 03:38:21 PM »
Hello,
I see the 50% of my disk files are almost the Apache domlogs. How can I disable/enable them when I need it?

Thanks!
You may use our FREE SMTP Newsletter APP at https://www.emailbat.com

Offline
**
Re: CWP Apache domlogs cover 50% of my disk
« Reply #1 on: January 21, 2023, 10:01:13 PM »
If you don't need to save them, first start by truncating your apache error & access logs to zero bytes:
Code: [Select]
truncate -s0 /usr/local/apache/domlogs/*.error.log
truncate -s0 /usr/local/apache/domlogs/*.log
Also consider doing the same if you are sure you don't need your CWP access/error logs (for security auditing/troubleshooting):
Code: [Select]
truncate -s0 /usr/local/cwpsrv/logs/*_logAlso, look under /usr/local/cwp/php71/var/log/

To automatically rotate the logs, add a configuration to logrotate for apache logs. Put this code into /etc/logrotate.d/httpd (or use File Management > Logrotate Manager to create it):
Code: [Select]
/usr/local/apache/domlogs/*log {
    missingok
    notifempty
    sharedscripts
    daily
    rotate 7
    postrotate
        /bin/systemctl reload httpd.service > /var/log/httpd-rotate.log 2>&1 || true
    endscript
    compress
}
« Last Edit: January 21, 2023, 10:26:53 PM by overseer »

Offline
*
Re: CWP Apache domlogs cover 50% of my disk
« Reply #2 on: January 22, 2023, 05:57:29 PM »
Will that STOP the logs? These files are really huge.
You may use our FREE SMTP Newsletter APP at https://www.emailbat.com

Offline
**
Re: CWP Apache domlogs cover 50% of my disk
« Reply #3 on: January 22, 2023, 06:03:47 PM »
What I am suggesting is that you truncate them to 0 bytes -- then start fresh with log rotation (keeping only 7 copies) that are compressed. So it won't build up like that again -- much more manageable but still there for reference in case of an error or security breach.

Offline
*
Re: CWP Apache domlogs cover 50% of my disk
« Reply #4 on: January 23, 2023, 03:52:52 PM »
That configuration to logrotate for apache logs will be lost after CWP updates?
You may use our FREE SMTP Newsletter APP at https://www.emailbat.com

Offline
**
Re: CWP Apache domlogs cover 50% of my disk
« Reply #5 on: January 23, 2023, 06:32:18 PM »
It shouldn't; it's a new file you create in the /etc/logrotate.d directory which is a CentOS system directory.
CWP has an interface for creating/managing logrotate jobs under File Management > Logrotate Manager.