From 8bbc90106f8a516f26f13950c18ad31bcb93e22e Mon Sep 17 00:00:00 2001 From: root Date: Sat, 31 Jan 2026 00:21:27 +0200 Subject: [PATCH] Extend log rotation for ModSecurity and app logs --- install.sh | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 684f520..9ff9a4b 100755 --- a/install.sh +++ b/install.sh @@ -2953,7 +2953,7 @@ setup_scheduler_cron() { log "Laravel scheduler configured - SSL auto-renewal and backups will run automatically" } -# Setup logrotate for user domain logs +# Setup logrotate for user domain logs and Jabali services setup_logrotate() { header "Setting Up Log Rotation" @@ -2972,9 +2972,35 @@ setup_logrotate() { invoke-rc.d nginx rotate >/dev/null 2>&1 endscript } + +# ModSecurity audit log (when enabled) +/var/log/nginx/modsec_audit.log /var/log/modsec_audit.log { + daily + missingok + rotate 14 + compress + delaycompress + notifempty + create 0640 www-data adm + sharedscripts + postrotate + invoke-rc.d nginx rotate >/dev/null 2>&1 + endscript +} + +# Jabali application logs +/var/www/jabali/storage/logs/*.log { + daily + missingok + rotate 14 + compress + delaycompress + notifempty + create 0640 www-data www-data +} LOGROTATE - log "Log rotation configured for user domain logs" + log "Log rotation configured for Jabali logs (domains, ModSecurity, app logs)" } # Setup SSL certificates for panel and mail services