From e1356e3eb0e7cf84f5a9df24d8966fdd9058d8cf Mon Sep 17 00:00:00 2001 From: bunkerity Date: Sun, 25 Oct 2020 16:25:54 +0100 Subject: [PATCH] logrotate.conf update and some cleanup --- entrypoint.sh | 25 ++++++------------------- logs/logrotate.conf | 2 +- logs/rsyslog.conf | 3 --- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0b9c7f6..4e85b06 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -571,36 +571,23 @@ rsyslogd # start crond crond -# start nginx -if [ ! -f "/var/log/access.log" ] ; then - touch /var/log/access.log -fi -if [ ! -f "/var/log/error.log" ] ; then - touch /var/log/error.log -fi +# create empty logs +touch /var/log/access.log +touch /var/log/error.log -# modsec logs -touch /var/log/modsec_audit.log -chown root:nginx /var/log/modsec_audit.log -chmod 760 /var/log/modsec_audit.log - -# nginx default error log -touch /var/log/nginx/error.log -chown root:nginx /var/log/nginx/error.log -chmod 760 /var/log/nginx/error.log - -# nginx configs (and modules through the symlink) +# fix nginx configs rights (and modules through the symlink) chown -R root:nginx /etc/nginx/ chmod -R 740 /etc/nginx/ find /etc/nginx -type d -exec chmod 750 {} \; -# let's encrypt +# fix let's encrypt rights if [ "$AUTO_LETS_ENCRYPT" = "yes" ] ; then chown -R root:nginx /etc/letsencrypt chmod -R 740 /etc/letsencrypt find /etc/letsencrypt -type d -exec chmod 750 {} \; fi +# start nginx echo "[*] Running nginx ..." su -s "/usr/sbin/nginx" nginx diff --git a/logs/logrotate.conf b/logs/logrotate.conf index f5dcd52..735f626 100644 --- a/logs/logrotate.conf +++ b/logs/logrotate.conf @@ -1,4 +1,4 @@ -/var/log/messages /var/log/*.log /var/log/clamav/*.log /var/log/php7/*.log { +/var/log/*.log /var/log/clamav/*.log /var/log/nginx/*.log { # compress old files using gzip compress diff --git a/logs/rsyslog.conf b/logs/rsyslog.conf index dd92353..e760709 100644 --- a/logs/rsyslog.conf +++ b/logs/rsyslog.conf @@ -25,6 +25,3 @@ module(load="imuxsock") $template rawFormat,"%msg:2:2048%\n" local0.=notice /var/log/access.log;rawFormat local0.*;local0.!=notice /var/log/error.log;rawFormat - -# PHP -local1.* /var/log/php.log