diff --git a/install/nginx-log-format.sh b/install/01-nginx-log-format.sh similarity index 100% rename from install/nginx-log-format.sh rename to install/01-nginx-log-format.sh diff --git a/install/nginx-conf.sh b/install/10-nginx-conf.sh old mode 100755 new mode 100644 similarity index 95% rename from install/nginx-conf.sh rename to install/10-nginx-conf.sh index 4c619a3..f70971d --- a/install/nginx-conf.sh +++ b/install/10-nginx-conf.sh @@ -30,3 +30,6 @@ cp -v "$SRC_DIR"/*.conf "$DEST_DIR/" echo "Setting permissions..." chown root:root "$DEST_DIR"/*.conf chmod 644 "$DEST_DIR"/*.conf + +# Reload nginx +service nginx reload diff --git a/install/nginx-snippets.sh b/install/10-nginx-snippets.sh old mode 100755 new mode 100644 similarity index 95% rename from install/nginx-snippets.sh rename to install/10-nginx-snippets.sh index f3df5f9..dde6c0d --- a/install/nginx-snippets.sh +++ b/install/10-nginx-snippets.sh @@ -30,3 +30,6 @@ cp -v "$SRC_DIR"/*.conf "$DEST_DIR/" echo "Setting permissions..." chown root:root "$DEST_DIR"/*.conf chmod 644 "$DEST_DIR"/*.conf + +# Reload nginx +service nginx reload \ No newline at end of file diff --git a/install/nginx-cloudflare-fail2ban.sh b/install/20-nginx-cloudflare-fail2ban.sh similarity index 94% rename from install/nginx-cloudflare-fail2ban.sh rename to install/20-nginx-cloudflare-fail2ban.sh index 16ebe09..8578431 100644 --- a/install/nginx-cloudflare-fail2ban.sh +++ b/install/20-nginx-cloudflare-fail2ban.sh @@ -35,9 +35,8 @@ actionban = grep -q '^ 1;$' /etc/nginx/maps/banned_ips.conf || echo ' 1; actionunban = sed -i '/^ 1;$/d' /etc/nginx/maps/banned_ips.conf && nginx -s reload ACTIONFILE -# Test NGINX configuration -echo "Testing NGINX configuration..." -nginx -t +# Reload nginx +service nginx reload echo "Installation complete!" echo "Now add 'nginx-banned-ips' to the action line in your existing fail2ban jail configurations" diff --git a/install/mysql.sh b/install/mysql.sh index 1e55be1..508baab 100755 --- a/install/mysql.sh +++ b/install/mysql.sh @@ -12,6 +12,9 @@ HOSTNAME=$(hostname -f) # Install MySQL and Certbot apt install mysql-server certbot -y +# Restart nginx for good measure +service nginx restart + # Generate SSL certificate certbot certonly --webroot -w /var/www/default -d $HOSTNAME --agree-tos --register-unsafely-without-email --non-interactive