logging fix again
This commit is contained in:
parent
022a653ebc
commit
34a0da444f
@ -52,7 +52,7 @@ SecResponseBodyLimitAction ProcessPartial
|
|||||||
SecAuditEngine RelevantOnly
|
SecAuditEngine RelevantOnly
|
||||||
SecAuditLogRelevantStatus "^(?:5|4(?!04))"
|
SecAuditLogRelevantStatus "^(?:5|4(?!04))"
|
||||||
SecAuditLogType Serial
|
SecAuditLogType Serial
|
||||||
SecAuditLog /var/log/modsec_audit.log
|
SecAuditLog /var/log/nginx/modsec_audit.log
|
||||||
|
|
||||||
# scan uploaded files with clamv
|
# scan uploaded files with clamv
|
||||||
%USE_CLAMAV_UPLOAD%
|
%USE_CLAMAV_UPLOAD%
|
||||||
|
|||||||
@ -612,14 +612,14 @@ fi
|
|||||||
# setup logrotate
|
# setup logrotate
|
||||||
replace_in_file "/etc/logrotate.conf" "%LOGROTATE_MAXAGE%" "$LOGROTATE_MAXAGE"
|
replace_in_file "/etc/logrotate.conf" "%LOGROTATE_MAXAGE%" "$LOGROTATE_MAXAGE"
|
||||||
replace_in_file "/etc/logrotate.conf" "%LOGROTATE_MINSIZE%" "$LOGROTATE_MINSIZE"
|
replace_in_file "/etc/logrotate.conf" "%LOGROTATE_MINSIZE%" "$LOGROTATE_MINSIZE"
|
||||||
echo "0 0 * * * logrotate -f /etc/logrotate.conf > /dev/null 2>&1 && pkill -HUP rsyslogd && fail2ban-client restart && nginx -s reload" >> /etc/crontabs/root
|
echo "0 0 * * * /opt/scripts/logrotate.sh > /dev/null 2>&1" >> /etc/crontabs/root
|
||||||
|
|
||||||
# display logs
|
# display logs
|
||||||
LOGS="/var/log/access.log /var/log/error.log"
|
LOGS="/var/log/access.log /var/log/error.log"
|
||||||
if [ "$USE_FAIL2BAN" = "yes" ] ; then
|
if [ "$USE_FAIL2BAN" = "yes" ] ; then
|
||||||
LOGS="$LOGS /var/log/fail2ban.log"
|
LOGS="$LOGS /var/log/fail2ban.log"
|
||||||
fi
|
fi
|
||||||
tail -f $LOGS &
|
tail -F $LOGS &
|
||||||
wait $!
|
wait $!
|
||||||
|
|
||||||
# sigterm trapped
|
# sigterm trapped
|
||||||
|
|||||||
11
scripts/logrotate.conf
Normal file
11
scripts/logrotate.conf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
logrotate -f /etc/logrotate.conf > /dev/null 2>&1
|
||||||
|
|
||||||
|
pkill -HUP rsyslogd
|
||||||
|
|
||||||
|
fail2ban-client flushlogs
|
||||||
|
|
||||||
|
if [ -f /tmp/nginx.pid ] ; then
|
||||||
|
/usr/sbin/nginx -s reload
|
||||||
|
fi
|
||||||
Loading…
x
Reference in New Issue
Block a user