eGov ERP DevOps
Load Balancer
Step 1 — Installing Apache
date
sudo dpkg-reconfigure tzdata
sudo apt update
sudo apt install apache2
Step 2 — Adjusting the Firewall
sudo ufw app list
sudo ufw allow 'Apache'
Step 3 — Checking your Web Server
sudo systemctl status apache2
Step 4 — Setting Up Virtual Hosts
sudo a2enmod proxy*
sudo a2enmod rewrite
sudo service apache2 restart
sudo apt-get update -y
sudo apt-get install build-essential unzip curl wget rsync apache2 redis-server -y
sudo a2enmod proxy
sudo a2enmod proxy_ajp
sudo a2enmod proxy_http
sudo a2enmod rewrite
sudo a2enmod deflate
sudo a2enmod headers
sudo a2enmod proxy_balancer
sudo a2enmod proxy_connect
sudo a2enmod proxy_html
sudo a2enmod lbmethod_*
sudo a2enmod ssl
sudo a2enmod reqtimeout
sudo service apache2 restar
sudo add-apt-repository ppa:certbot/certbot
root:/etc/apache2/proxy_template.conf
RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
ProxyTimeout 600
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
<Proxy balancer://devcluster>
BalancerMember https://<internal_ip>:8443
Order allow,deny
Allow from all
ProxySet lbmethod=byrequests
</Proxy>
ProxyPass / balancer://devcluster/
ProxyPassReverse / balancer://devcluster/
root:/etc/apache2/site-enabled/host_name.org.conf
##### Host entry for 'host_name'
<VirtualHost *:80>
ProxyRequests off
ProxyPreserveHost On
ServerName host_name.org
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) /egi/ [R=301]
Include /etc/apache2/proxy_template.conf
</VirtualHost>
root:/etc/apache2/sites-enabled# sudo certbot --apache -d host_name.org
DevOps as a Culture