diff --git a/RevProxySimple.sh b/RevProxySimple.sh index 5a43696..b033793 100644 --- a/RevProxySimple.sh +++ b/RevProxySimple.sh @@ -10,8 +10,9 @@ server_ip=$(hostname -I|cut -f1 -d ' ') # Block direct apache acces #ufw deny 8080/tcp -# Create domain specific folder -mkdir -p /var/www/"$domain"/html +# Setup domain folders +rm /var/www/html +mkdir -p /var/www/"$domain"/public_html ##-----------## # NGINX # @@ -23,8 +24,8 @@ cat < /etc/nginx/sites-available/"$domain" server { listen 80; - root /var/www/$domain/html; - index index.php index.html index.htm; + root /var/www/$domain/public_html; + index index.html index.htm index.php; server_name $domain www.$domain; @@ -60,7 +61,7 @@ cat < /etc/apache2/sites-available/"$domain".conf ServerAdmin $email ServerName $domain ServerAlias www.$domain - DocumentRoot /var/www/$domain/html + DocumentRoot /var/www/$domain/public_html ErrorLog \${APACHE_LOG_DIR}/error.log CustomLog \${APACHE_LOG_DIR}/access.log combined @@ -79,9 +80,9 @@ apt install -y libapache2-mod-php php-mysql php-cgi php-common php-pear php-mbst ##----------------## apt install -y phpmyadmin -ln -s /usr/share/phpmyadmin /var/www/"$domain"/html/phpmyadmin +ln -s /usr/share/phpmyadmin /var/www/"$domain"/public_html/phpmyadmin # Redirect phpmyadmin -> database -mv /var/www/"$domain"/html/phpmyadmin /var/www/"$domain"/html/database +mv /var/www/"$domain"/public_html/phpmyadmin /var/www/"$domain"/public_html/database a2disconf phpmyadmin.conf systemctl restart apache2 @@ -184,9 +185,9 @@ if [ $wordpress = 1 ] wget https://wordpress.org/latest.tar.gz -O /tmp/wp.tar.gz tar xzvf /tmp/wp.tar.gz -C /tmp mv /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php - cp -a /tmp/wordpress/. /var/www/"$domain"/html + cp -a /tmp/wordpress/. /var/www/"$domain"/public_html WPSalts=$(wget https://api.wordpress.org/secret-key/1.1/salt/ -q -O -) -cat < /var/www/"$domain"/html/wp-config.php +cat < /var/www/"$domain"/public_html/wp-config.php /var/www/"$domain"/html/info.php <<- "EOF" +cat > /var/www/"$domain"/public_html/info.php <<- "EOF"