linux - fix /var/log and typo in daemon directive

This commit is contained in:
bunkerity 2021-06-23 14:26:33 +02:00
parent 4991922878
commit 98568a57c9
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
2 changed files with 17 additions and 1 deletions

View File

@ -42,7 +42,7 @@ if [ -f "/tmp/nginx.pid" ] ; then
# Otherwise start it
else
echo "[*] Start nginx"
do_and_check_cmd "nginx -g 'daemon off;'"
do_and_check_cmd "nginx -g 'daemon on;'"
fi
# Run post-jobs

View File

@ -215,6 +215,22 @@ do_and_check_cmd chown -R nginx:nginx /etc/nginx
do_and_check_cmd find /etc/nginx -type f -exec chmod 0774 {} \;
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
if [ ! -e "/var/log/nginx" ] ; then
do_and_check_cmd mkdir /var/log/nginx
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 chmod 770 /var/log/access.log
do_and_check_cmd chmod 770 /var/log/error.log
do_and_check_cmd chmod -R 770 /var/log/nginx
# Install cron
echo "[*] Add jobs to crontab"
if [ "$OS" = "debian" ] || [ "$OS" = "ubuntu" ] ; then