Tools: Update: Troubleshooting Datacenter: Resolving Apache Service Reachability On Server
Investigating with Telnet
SSH Into Server
Resolving Port Binding Conflicts
Ensure Network Access
Final End-to-End Verification A server was supposed to be serving web content via Apache on port 5002, anyone trying to connect was met with a "No route to host" or "Connection refused" error. Here is a breakdown of how to investigate and eventually restore the service. The telnet command in Linux is a networking tool used to communicate with a remote host using the TELNET protocol. While it was originally designed for remote login and management, its lack of encryption (sending data like passwords in plain text) has made it largely obsolete for that purpose there. For secure remote access, always use the SSH (ssh) command instead.
Today, it is primarily used as a quick diagnostic tool to check if a specific TCP port is open and reachable on a remote server. The standard command structure is: hostname/Ip: The address of the remote server port: The target service port (e.g., 80 for HTTP). If omitted, it defaults to port 23. To Exit/Close, Type quit at the telnet> prompt and press Enter. To log into a remote server: A port binding conflict in Linux occurs when a service or application attempts to listen on a network port that is already in use by another process, preventing the new service from starting. Here is the technical workflow used to resolve binding conflicts. To Stop the service or kill the process ID Adjusting Network Access Rules using iptables. A running service does not guarantee external reachability if the system's firewall blocks incoming traffic. Explicitly add a rule to allow ingress TCP traffic on port 5002. This bridges the gap between the service being "up" and the service being "accessible." The final stage is the verification of the fix from an external source, typically the Jump Host (a secure intermediary server used to access and manage devices in a separate, secure, or private network zone). Using curl provides a definitive test of the entire communication stack. Investigate using telnet Identified and terminated the unauthorized process occupying port 5002, successfully releasing the port bind for the web service using ss. Re-initialized the Apache service after verifying configuration alignment, ensuring it was successfully listening on the designated port using systemctl. Updated the iptables configuration to explicitly permit external ingress traffic on port 5002, bridging the gap between local service activity and external accessibility. Confirmed full restoration of the communication path via curl from the jump host, verifying that the web server is once again reachable and performing as expected using curl. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to ? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse