devops-demo/Section_06/reverse_proxy.sh

24 lines
664 B
Bash

#!/bin/bash
# Apache2
sudo systemctl enable apache2 --now
sudo a2enmod proxy proxy_http proxy_ajp rewrite deflate headers proxy_balancer proxy_connect proxy_html
sudo systemctl restart apache2
cd /etc/apache2/sites-available/
sudo nano reverse_proxy.conf
sudo a2dissite 000-default
sudo a2ensite reverse_proxy
sudo systemctl reload apache2
# sudo systemctl stop apache2
# sudo systemctl disable apache2
# Install Nginx
sudo systemctl enable nginx --now
cd /etc/nginx/sites-available/
sudo nano reverse_proxy
sudo rm ../sites-enabled/*
sudo ln reverse_proxy ../sites-enabled/
sudo systemctl reload nginx
# sudo systemctl stop nginx
# sudo systemctl disable nginx