Nginx per-site log and Wordpress init script using

This commit is contained in:
2020-07-30 14:16:33 +02:00
parent 9cce3cc75a
commit f24076bb43
8 changed files with 33 additions and 1 deletions

View File

@@ -1,4 +1,8 @@
#beginConf
#access_log /var/log/nginx/Backend-access.log;
error_log /var/log/nginx/Backend-error.log;
location = /backend/netdata {
return 301 /backend/netdata/;
}

View File

@@ -1,4 +1,8 @@
#beginConf
#access_log /var/log/nginx/SITEname-access.log;
error_log /var/log/nginx/SITEname-error.log;
root /var/www/DOMAINname/html;
# Set max upload size
client_max_body_size 1G;

View File

@@ -1,4 +1,8 @@
#beginConf
#access_log /var/log/nginx/SITEname-access.log;
error_log /var/log/nginx/SITEname-error.log;
index index.php index.html index.htm index.nginx-debian.html;
root /var/www/DOMAINname/html;
gzip on;

View File

@@ -0,0 +1,5 @@
#!/bin/sh
red='\e[1;31m%s\e[0m\n'
printf "\n"
printf $red "Please run wordpress-init.sh after the first wordpress login"
printf "\n"

View File

@@ -1,4 +1,8 @@
#beginConf
#access_log /var/log/nginx/SITEname-access.log;
error_log /var/log/nginx/SITEname-error.log;
root /var/www/DOMAINname/html;
index index.php index.htm index.html;

View File

@@ -41,3 +41,9 @@ systemctl reload php"$phpver"-fpm
#Setting Permsissions
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
#Makeing wordpress Finalize script and setting login Notice
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/wordpress-init.sh -O ~/wordpress-init.sh
sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/wordpress-init.sh
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/MotdWordpress -O /etc/update-motd.d/50-wpnotice
chmod +x /etc/update-motd.d/50-wpnotice

View File

@@ -0,0 +1,5 @@
sudo -u SITEname wp --path=/var/www/DOMAINname/html core update
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin update --all
sudo -u SITEname wp --path=/var/www/DOMAINname/html theme update --all
sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin install wp-fail2ban --activate
rm -f /etc/update-motd.d/50-wpnotice