Day 16 of 100 Days of Devops
Install and Configure Nginx as an LBR
Day by day traffic is increasing on one of the websites managed by the Nautilus production support team. Therefore, the team has observed a degradation in website performance. Following discussions about this issue, the team has decided to deploy this application on a high availability stack i.e on Nautilus infra in Stratos DC. They started the migration last month and it is almost done, as only the LBR server configuration is pending. Configure LBR server as per the information given below:
a. Install nginx on LBR (load balancer) server.
b. Configure load-balancing with the an http context making use of all App Servers. Ensure that you update only the main Nginx configuration file located at /etc/nginx/nginx.conf.
c. Make sure you do not update the apache port that is already defined in the apache configuration on all app servers, also make sure apache service is up and running on all app servers.
d. Once done, you can access the website using StaticApp button on the top bar.
Verifying httpd port
As usual ssh into app server.
1
2
[tony@stapp01 ~]$ sudo ss -tulnp | grep httpd
tcp LISTEN 0 511 0.0.0.0:8082 0.0.0.0:* users:(("httpd",pid=1689,fd=3),("httpd",pid=1688,fd=3),("httpd",pid=1687,fd=3),("httpd",pid=1679,fd=3))
Check from BastionHost
1
telnet stapp01 8082
Nginx config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
http{
upstream backend {
server <App_Server_IP_1>:<Apache_Port>;
server <App_Server_IP_2>:<Apache_Port>;
server <App_Server_IP_3>:<Apache_Port>;
}
server {
listen 80;
# other configs
location / {
proxy_pass http://backend;
}
}
}
Verification
1
sudo systemctl restart nginx
Thats all for today , Thx Bye !