logs - move everything from /var/log to /var/log/nginx

This commit is contained in:
bunkerity
2021-07-07 14:36:00 +02:00
parent d03a1a6e3b
commit e241b0c939
5 changed files with 24 additions and 22 deletions

View File

@@ -219,21 +219,27 @@ do_and_check_cmd find /etc/nginx -type d -exec chmod 0775 {} \;
# Prepare log files and folders
echo "[*] Prepare log files and folders"
do_and_check_cmd touch /var/log/access.log
do_and_check_cmd touch /var/log/error.log
do_and_check_cmd touch /var/log/jobs.log
if [ ! -e "/var/log/nginx" ] ; then
do_and_check_cmd mkdir /var/log/nginx
fi
if [ ! -e /var/log/nginx/access.log ] ; then
do_and_check_cmd touch /var/log/nginx/access.log
fi
if [ ! -e /var/log/nginx/error.log ] ; then
do_and_check_cmd touch /var/log/nginx/error.log
fi
if [ ! -e /var/log/nginx/jobs.log ] ; then
do_and_check_cmd touch /var/log/nginx/jobs.log
fi
do_and_check_cmd touch /var/log/nginx/modsec_audit.log
do_and_check_cmd touch /var/log/nginx/error.log
do_and_check_cmd chown -R root:nginx /var/log/nginx
do_and_check_cmd chown root:nginx /var/log/access.log
do_and_check_cmd chown root:nginx /var/log/error.log
do_and_check_cmd chown root:nginx /var/log/jobs.log
do_and_check_cmd chmod 770 /var/log/access.log
do_and_check_cmd chmod 770 /var/log/error.log
do_and_check_cmd chmod 770 /var/log/jobs.log
do_and_check_cmd chown root:nginx /var/log/nginx/access.log
do_and_check_cmd chown root:nginx /var/log/nginx/error.log
do_and_check_cmd chown root:nginx /var/log/nginx/jobs.log
do_and_check_cmd chmod 770 /var/log/nginx/access.log
do_and_check_cmd chmod 770 /var/log/nginx/error.log
do_and_check_cmd chmod 770 /var/log/nginx/jobs.log
do_and_check_cmd chmod -R 770 /var/log/nginx
# Prepare Let's Encrypt files and folders