Author Topic: CWP Apache domlogs cover 50% of my disk  (Read 2995 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.

Offline
**
Re: CWP Apache domlogs cover 50% of my disk
« Reply #6 on: February 17, 2024, 06:10:35 PM »
ok that works. Do I have to configure extra cron job for that also? 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 #7 on: February 17, 2024, 08:43:45 PM »
No, logrotate already happens -- you're just adding a job to its task list. No additional cronjob necessary. You'll find that the roundcube and dovecot IMAP logs also need to be rotated, or they too balloon to become HUGE.

Offline
**
Re: CWP Apache domlogs cover 50% of my disk
« Reply #8 on: February 20, 2024, 09:57:42 AM »
Thanks.
You may use our FREE SMTP Newsletter APP at https://www.emailbat.com