Extend log rotation for ModSecurity and app logs

This commit is contained in:
root
2026-01-31 00:21:27 +02:00
parent 1b7b0a46d2
commit 8bbc90106f

View File

@@ -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