Ref: https://youtu.be/9SC1yabcz4k
to install apache server on centos:
systemctl enable httpd
systemctl start httpd
firewall-cmd –permanent –add-service http
firewall-cmd –reload
netstat -nltp
to install apache server on ubuntu: https://ubuntu.com/tutorials/install-and-configure-apache#1-overview
Figlet is for creating sample html design for testing:
yum install figlet
on ubuntu : https://zoomadmin.com/HowToInstall/UbuntuPackage/figlet
figlet cenvm01 > /var/www/html/index.html
To install nginx server and configure the load balancer:
yum install nginx
systemcl enable/start nginx
firewall-cmd –permanent –add-service http
firewall-cmd –reload
vi /etc/nginx/nginx.conf
#HTTP part only in the conf file
http{
upstream lbmysite {
server cenvm01.jungle.kvm;
server cenvm02.jungle.kvm;
}
server {
location / {
proxy_pass http://lbmysite;
}
}
}
systemctl reload nginx
netstat -nltp
firewall-cmd –list-all
host mysite
curl http://mysite
Leave a comment