On a large Virtualmin server, for some domains, you might encounter the following issue when enabling and disabling log rotation using the command line. The bottom line here is when disabling the feature, it reports no log rotation configuration
. Then, when enabling it again, it reports already enabled
. See my dilemma?
Example Problem
Disabling it:
root@server:/root# virtualmin disable-feature --logrotate --domain example.com Updating server example.com .. Updating Webmin user .. .. done Disabling log file rotation .. .. Error: no log rotation configuration found for $1 .. done Re-loading Webmin .. .. done
Then when you enable it again:
root@server:/root# virtualmin enable-feature --logrotate --domain example.com Updating server example.com .. Setting up log file rotation .. .. already enabled for log file /var/log/virtualmin/example.com_access_log Updating Webmin user .. .. done .. done Re-loading Webmin .. .. done
How to Troubleshoot
Virtualmin uses the standard log rotation daemon. The configuration file is /etc/logrotate.conf
In there you’ll find the usual include setup:
# packages drop log rotation information into this directory include /etc/logrotate.d
Next track down that folder, and in there you’ll find virtualmin.conf
The best is to:
- Make a backup of the file
- Manually fiddle with the file
Why is this happening?
The most likely cause is the Perl script that interprets that file is encountering a hiccup so best to fix it by hand.
Other Possible Errors
If you try to add log rotation on an alias, you’ll get this:
Enabling logrotate for staging.example.com... Updating server staging.example.com .. Setting up log file rotation .. .. done Updating Webmin user .. Use of uninitialized value $extras[2] in join or string at /usr/libexec/webmin/virtualmin-nginx/virtual_feature.pl line 1016. Use of uninitialized value $mode in string ne at /usr/libexec/webmin/virtualmin-nginx/virtual_feature.pl line 1028. .. done .. done Re-loading Webmin .. .. done
Reference
Also refer to file
/etc/webmin/virtual-server/domains/
where log rotation=
parameters are stored.