• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Subdomain logs are not rotated

wilei

New Pleskian
Hi,

I'm running Plesk 12.5.30 (Update 40) on CentOS 7.2.1511, with latest updates installed for both Plesk and OS.

I found out that Plesk is missing correct log rotation rules for subdomain HTTP access logs (both logs from Apache and Nginx). I did some digging and there is no any configurations for subdomain log rotation in /usr/local/psa/etc/logrotate.d.

Let's say that domain I'm hosting with Plesk is domain.tld and subdomain under this domain is subdomain.domain.tld. Subdomain is used just to deliver huge amount of images, PHP etc. features are turned off for this subdomain, so it's only for static data. SSL for all connections.

Logs for domain.tld are found from path:
/var/www/vhosts/system/domain.tld/logs/

And for subdomain subdomain.domain.tld from path:
/var/www/vhosts/system/subdomain.domain.tld/logs/

There is log rotate configuration for domain.tld in file /usr/local/psa/etc/logrotate.d/domain.tld. But there is no rules for subdomain log rotation. There is this rotation group in configs: /var/www/vhosts/system/domain.tld/logs/*.processed but no group for subdomain logs.

This has led to situation where log /var/www/vhosts/system/subdomain.domain.tld/logs/access_ssl_log.processed has grown to pretty huge. 14 gigabytes and counting as there is no rotation for file.


How this can be fixed? And editing /usr/local/psa/etc/logrotate.d/domain.tld is out-of-scope as it's auto-generated by Plesk. Also all custom rotation configs are out-of-scope as these configs must be also auto-generated as domain log rotate configs are.
 
Yes, it is known issue. I have updated already existing report OMO-192 with your case.
 
Also, you can try to use the following workaround:

# plesk bin domain --update sub.domain.com -log-rotate true
 
Tried that provided workaround:

# plesk bin domain --update sub.domain.com -log-rotate true

And it created configuration for the log rotation. But the contents of the file is "wrong".

For the domain log rotation rules are:
/var/www/vhosts/system/domain.tld/logs/*.processed {
weekly
rotate 104
compress
missingok
}

but newly created rotation rules for subdomain.domain.tld are:
/var/www/vhosts/system/subdomain.domain.tld/logs/*.processed {
size=5242880
rotate 0
compress
missingok
}

Funny enough, I found out that logs for the another subdomain (under the same domain) but which is created way back earlier that the one with problems, has working log file rotation. For it log files are rotated once in a week. And rules for that domain are correct:

/var/www/vhosts/system/sub2.domain.tld/logs/*.processed {
weekly
compress
missingok
rotate 104
}
 
As far as I know this bug will be completely fixed in Plesk Onyx.
 
Back
Top