'RevProxySimple.sh' updaten
This commit is contained in:
@@ -7,9 +7,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
|
||||||
# Create domain specific folder
|
# Create domain specific folder
|
||||||
mkdir -p /var/www/"$domain"/html
|
mkdir -p /var/www/"$domain"/html
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ mkdir -p /var/www/"$domain"/html
|
|||||||
# NGINX #
|
# NGINX #
|
||||||
##-----------##
|
##-----------##
|
||||||
|
|
||||||
apt install -y nginx
|
apt install -y nginx mysql-server
|
||||||
rm /etc/nginx/sites-enabled/default
|
rm /etc/nginx/sites-enabled/default
|
||||||
cat <<EOF > /etc/nginx/sites-available/"$domain"
|
cat <<EOF > /etc/nginx/sites-available/"$domain"
|
||||||
server {
|
server {
|
||||||
@@ -36,7 +36,7 @@ server {
|
|||||||
proxy_set_header X-Real-IP \$remote_addr;
|
proxy_set_header X-Real-IP \$remote_addr;
|
||||||
proxy_set_header X-Forwarded-For \$remote_addr;
|
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||||
proxy_set_header Host \$host;
|
proxy_set_header Host \$host;
|
||||||
proxy_pass http://$server_ip:8080;
|
proxy_pass http://127.0.0.1:8080;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ /\.ht {
|
location ~ /\.ht {
|
||||||
@@ -53,10 +53,10 @@ nginx_ensite "$domain"
|
|||||||
|
|
||||||
apt install -y apache2
|
apt install -y apache2
|
||||||
mv /etc/apache2/ports.conf /etc/apache2/ports.conf.default
|
mv /etc/apache2/ports.conf /etc/apache2/ports.conf.default
|
||||||
echo "Listen $server_ip:8080" | tee /etc/apache2/ports.conf
|
echo "Listen 127.0.0.1:8080" | tee /etc/apache2/ports.conf
|
||||||
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/"$domain".conf
|
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/"$domain".conf
|
||||||
cat <<EOF > /etc/apache2/sites-available/"$domain".conf
|
cat <<EOF > /etc/apache2/sites-available/"$domain".conf
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:8080>
|
||||||
ServerAdmin $email
|
ServerAdmin $email
|
||||||
ServerName $domain
|
ServerName $domain
|
||||||
ServerAlias www.$domain
|
ServerAlias www.$domain
|
||||||
|
|||||||
Reference in New Issue
Block a user