Skip to main content

Command Palette

Search for a command to run...

Day 14/100 of DevOps

Day 14: Linux Process Troubleshooting

Updated
2 min read

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:

  1. Login to the App server

    ssh tony@172.16.238.10

  2. Check the status of the HTTPD service

    sudo systemctl status httpd

  3. Analyze the logs.

    From the below line, we can see HTTPD service is not running on port 5001.

  4. Check which process is already using the port

    sudo netstat -tulnp | grep 5001

    Sendmail (PID: 497) is running on port 5001.

  5. Kill the current process

    kill -9 497

    Now the port is free, as currently no service is using the port.

  6. Start the HTTPD service and check the status

    sudo systemctl start httpd

    sudo systemctl status httpd

  7. Verify

    sudo netsat -tulnp | grep 5001

    or, you can use curl command from jump server.

    curl http://server_ip:port_nos

    curl http://172.16.238.10:5001

    Now, repeat the process for other App servers.