Logrotate issue for system & virtualhost

Hello I trying to resolve issue with system logging, fresh install on Debian 9, all working perfect except system logging. In virtualhost or in modsec_audit logs I see system logs etc ... Apache logs looks like is ok, but virtualhost logs permissions are mess. Before rotation is virtual-server-name:www-data and after rotation is www-data:www-data, after mannually changing to virtual-server-name:www-data become www-data:www-data after new log rotation. I have checked Log File Rotation settings, from beginning (installation) log rotation for virtual server are www-data:www-data. Little help please, what is correct permissions for system logs, virtualhost (how to set it correct in Log File Rotation) etc. Thank you in advance

Status: 
Needs work

Comments

Ilia's picture
Submitted by Ilia on Tue, 04/21/2020 - 07:12

Hi,

Thanks for contacting us.

Before rotation is virtual-server-name:www-data and after rotation is www-data:www-data, after manually changing to virtual-server-name:www-data become www-data:www-data after new log rotation.

It seems that you made some manual changes? Double check that rotated logs in System/Log File Rotation/Edit Log File and its option Re-create log file after rotation? set to Default (Yes, with old permissions). You could also use custom mode and force logrotate to use specific mode.


By the way, this tracker for premium support only. You are welcome to use our brand new Community Forums, which we keep an eye on as well.

Hi, I already have tried make changes in "System/Log File Rotation/Edit Log Files", manually changing permissions ... recreated logs separate for every virtual server & subserver (domains/subdomains). System logs, delete and add again virtual server .... I have tried to change ErroRLogFormat/LogFormat in apache2 conf, tried reinstall Virtualmin on Debian 9 fresh, then on Debian 9 with "minimal" ... All in the same point - nothing changes, so probably this is the "bug" .... Or maybe this because one domain have "laravel" website running ... Issue like this I have first time ...

By the way, I own licence x 250 domain, please cherck my account and by the way i never ask for for support, if I have issue, what I can resolve myself. Thank you in advance

Ilia's picture
Submitted by Ilia on Tue, 04/28/2020 - 13:35

By the way, I own licence x 250 domain, please check my account

Sorry about that. Usually there is a star on the UI, near the Pro username but for some reason, it's not displayed in your case.

I already have tried make changes in "System/Log File Rotation/Edit Log Files", manually changing permissions.

What are the outputs of the following commands:

cat /etc/logrotate.conf
cat /etc/logrotate.d/*

As a work-around, you could run the command after log rotation is done, to change permissions:

Hello Ilia, With website logs I have resolved issue, but here I need some help:

cat /etc/logrotate.conf

see "man logrotate" for details rotate log files weekly

weekly

keep 4 weeks worth of backlogs

rotate 4

create new (empty) log files after rotating old ones

create

uncomment this if you want your log files compressed compress packages drop log rotation information into this directory

include /etc/logrotate.d

no packages own wtmp, or btmp -- we'll rotate them here

/var/log/wtmp { missingok monthly create 0664 root utmp rotate 1 }

/var/log/btmp { missingok monthly create 0660 root utmp rotate 1 }

system-specific logs may be configured here

/var/log/procmail.log { rotate 5 daily compress }

( I mean missing lines) Thank you