'RevProxySimple.sh' updaten
This commit is contained in:
@@ -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 <<EOF > /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 <<EOF > /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
|
||||
</VirtualHost>
|
||||
@@ -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 <<EOF > /var/www/"$domain"/html/wp-config.php
|
||||
cat <<EOF > /var/www/"$domain"/public_html/wp-config.php
|
||||
<?php
|
||||
define('DB_NAME', '$db_name');
|
||||
define('DB_USER', '$db_user');
|
||||
@@ -233,13 +234,13 @@ fi
|
||||
# OPCACHE GUI #
|
||||
##-----------------##
|
||||
|
||||
wget https://raw.githubusercontent.com/amnuts/opcache-gui/master/index.php -O /var/www/"$domain"/html/opcache.php
|
||||
wget https://raw.githubusercontent.com/amnuts/opcache-gui/master/index.php -O /var/www/"$domain"/public_html/opcache.php
|
||||
|
||||
##--------------##
|
||||
# info.php #
|
||||
##--------------##
|
||||
|
||||
cat > /var/www/"$domain"/html/info.php <<- "EOF"
|
||||
cat > /var/www/"$domain"/public_html/info.php <<- "EOF"
|
||||
<?php
|
||||
phpinfo();
|
||||
EOF
|
||||
@@ -248,5 +249,5 @@ EOF
|
||||
# Html Folder Perms #
|
||||
##-----------------------##
|
||||
|
||||
chown -R www-data:www-data /var/www/"$domain"/html
|
||||
chown -R www-data:www-data /var/www/"$domain"/public_html
|
||||
|
||||
|
||||
Reference in New Issue
Block a user