'RevProxyAdvanced.sh' updaten

This commit is contained in:
ictmaatwerk
2018-09-18 12:59:12 +00:00
parent 5bbcda03ad
commit f9ceb1b518

View File

@@ -10,9 +10,9 @@
# Set server IP variable for apache access # Set server IP variable for apache access
server_ip=$(hostname -I|cut -f1 -d ' ') server_ip=$(hostname -I|cut -f1 -d ' ')
# Block direct apache acces # Block direct apache acces
ufw deny 8080/tcp #ufw deny 8080/tcp
# Setup domain folder # Setup domain folder
mkdir -p /var/www/"$domain"/public_htm mkdir -p /var/www/"$domain"/public_html
#-------------------# #-------------------#
# APACHE + PHP-FPM # # APACHE + PHP-FPM #
@@ -40,7 +40,7 @@ mysql -u root -p"$passwd" -e "SELECT user,authentication_string,plugin,host FROM
mysql -u root -p"$passwd" -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '"$passwd"';" mysql -u root -p"$passwd" -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '"$passwd"';"
mysql -u root -p"$passwd" -e "FLUSH PRIVILEGES;" mysql -u root -p"$passwd" -e "FLUSH PRIVILEGES;"
mysql -u root -p"$passwd" -e "SELECT user,authentication_string,plugin,host FROM mysql.user;" mysql -u root -p"$passwd" -e "SELECT user,authentication_string,plugin,host FROM mysql.user;"
apt install libapache2-mod-php php-fpm php-mysql php-cgi php-common php-pear php-mbstring php-curl php-gd php-intl php-soap php-xml php-xmlrpc php-zip -y apt install -y libapache2-mod-php php-fpm php-mysql php-cgi php-common php-pear php-mbstring php-curl php-gd php-intl php-soap php-xml php-xmlrpc php-zip
#-------------------# #-------------------#
# MOD_FASTCGI # # MOD_FASTCGI #
@@ -116,7 +116,7 @@ nginx -t
# REVERSE PROXY # # REVERSE PROXY #
#-------------------# #-------------------#
cat <<EOF > /etc/nginx/sites-available/apache cat <<EOF > /etc/nginx/sites-available/"$domain"
server { server {
listen 80; listen 80;
server_name $domain www.$domain; server_name $domain www.$domain;
@@ -146,7 +146,7 @@ server {
#ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; #ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
} }
EOF EOF
ln -s /etc/nginx/sites-available/apache /etc/nginx/sites-enabled/apache ln -s /etc/nginx/sites-available/"$domain" /etc/nginx/sites-enabled/"$domain"
nginx -t nginx -t
systemctl reload nginx systemctl reload nginx