Day 14/100 of DevOps
Day 14: Linux Process Troubleshooting
Task: Identify the faulty app host and fix the issue. Make sure Apache service is up and running on all app hosts. They might not have hosted any code yet on these servers, so you don’t need to worry if Apache isn’t serving any pages. Just make sure the service is up and running. Also, make sure Apache is running on port 5001 on all app servers.
Let’s clearly define what’s expected of us to do in the task given:
- One of the app servers has Apache down:
A monitoring system flagged that Apache is not available on one of the app hosts. There are usually multiple app servers (e.g., stapp01, stapp02, stapp03). We need to identify, on which app server is the apache service not running or is in the failed state.
- Fix Apache on the faulty host:
Make sure the service is running.It doesn’t matter if it serves content — only that the service is up.
- Apache must use port 8085 on ALL app servers:
Even if the service is running, it may be running on the wrong port. So you must ensure the configuration (Listen directive) is correct on all hosts and is using the port 8085 only.
Step by Step Process:
Login to the App server
ssh tony@172.16.238.10

Check the status of the HTTPD service
sudo systemctl status httpd

Analyze the logs.
From the below line, we can see HTTPD service is not running on
port 5001.
Check which process is already using the port
sudo netstat -tulnp | grep 5001
Sendmail (PID: 497) is running on port 5001.
Kill the current process
kill -9 497
Now the port is free, as currently no service is using the port.
Start the HTTPD service and check the status
sudo systemctl start httpdsudo systemctl status httpd
Verify
sudo netsat -tulnp | grep 5001
or, you can use curl command from jump server.
curl http://server_ip:port_noscurlhttp://172.16.238.10:5001
Now, repeat the process for other App servers.