logrotate.conf update and some cleanup

This commit is contained in:
bunkerity 2020-10-25 16:25:54 +01:00
parent 34a0da444f
commit e1356e3eb0
No known key found for this signature in database
GPG Key ID: 654FFF51CEF7CC47
3 changed files with 7 additions and 23 deletions

View File

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

View File

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

View File

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