LAB 32 ‐ Troubleshooting Application Downtime: Initial Ingress & httpd Reachability - gautam-amitesh/OCI GitHub Wiki
When a user reports that “the application is down,” it means the user sent a request but did not receive a response from the application.
When a user sends a request (TCP packet), it goes through several checks before it finally reaches the backend application (Node/Python/Java). The user’s complaint does not reveal where in the chain the failure occurred; it only indicates that the client was unable to complete the request.
We follow the standard outside-in troubleshooting methodology, starting with Client/Hub Ingress Connectivity. If that fails, we then move to the Private Subnet’s Security List and Routing, followed by the App Server’s OS Firewall, then Verify httpd Running & Listening Status, and finally the Backend Application.
For testing this, there are some prerequisites listed below:
-
Networking setup includes HUB VCN & Public Subnet, SPOKE VCN & Private Subnet, Security Lists, Route Table, Internet Gateway (Hub), Dynamic Routing Gateway, VCN Attachments, and NAT Gateway (Spoke).
When installing the
httpdpackage on the App Server, we will temporarily need internet access. Therefore, we will create an additional security rule allowing internet traffic through the NAT Gateway, and once the installation is complete, we will remove it. -
Bastion & Application Server setup
Now before installing
httpdwe will update our Security Listsudo dnf install httpd -yhttpd -vOur
httpdinstallation is complete, which we have verified usinghttpd -v. We can now revert to our previous Security Rules.
Testing
-
First, we will test the connection on port
80of theapp_serverfrom thebastion_serverusingtelnet.telnet 10.1.0.26 80A connection hang or
Connection timed outindicates that traffic is being dropped at the Private Subnet routing or Security List layer. However, the error we receivedtelnet: connect to address 10.1.0.26: No route to hostmeans our Security List is properly configured, but the OS Firewall of theapp_serveris blocking the connection. -
Now we should check on the
app_serverto determine whether the firewall is active. This can be done usingsystemctl status firewalldorsudo firewall-cmd --state.systemctl status firewalld -
The firewall is active. Now we will check if it is allowing
HTTPby usingsudo firewall-cmd --list-all.sudo firewall-cmd --list-all -
We can see in the above screenshot that the firewall is only allowing
SSHanddhcpv6-client. Therefore, we can either deactivate the firewall which is not considered a good practice or explicitly and permanently allowhttpusingsudo firewall-cmd --permanent --add-service=http. After that, we need to reload the firewall to apply the change immediately by runningsudo firewall-cmd --reload. Finally, we will verify the change usingsudo firewall-cmd --list-all.sudo firewall-cmd --permanent --add-service=httpsudo firewall-cmd --reloadsudo firewall-cmd --list-all -
Now we will switch to the
bastion_serverand repeat step 1 to see if it is working.telnet 10.1.0.26 80 -
Now it is throwing a new error:
telnet: connect to address 10.1.0.26: Connection refused. Therefore, we should check whetherhttpdis running and listening on port80. To do this, first switch to theapp_server, and then runsudo systemctl status httpd.sudo systemctl status httpd -
When we install
httpd, it is inactive by default. Therefore, we need to start it usingsudo systemctl start httpdand verify its status again. We also need to keep theapp_serverlogged in; if we log out, theApache HTTP Servermight become inactive again.sudo systemctl start httpdsudo systemctl status httpd -
Now it is running, but it should also be listening on port
80to allow connections. Let’s check this by using:sudo netstat -plan | grep ':80'sudo netstat -plan | grep ':80'We can see that it has started listening as well. By default, when we start the
Apache HTTP Server, it also begins listening on port80. -
Now we can expect to connect without any errors. First, switch back to the
bastion_serveror just open a new terminal to log in tobastion_serverand let’s try again.telnet 10.1.0.26 80Now we can see its connected finally.