A "Connection refused" error means the service isn't running or the port is blocked.
1. Check If the Service Is Running
systemctl status nginx
systemctl status mysql
systemctl status sshd2. Check If the Port Is Listening
ss -tuln | grep :80
ss -tuln | grep :223. Check Firewall
ufw status
# or
firewall-cmd --list-all4. Check Logs
journalctl -u nginx --no-pager -n 50Common Solutions
- Start the service:
systemctl start nginx - Open the firewall port:
ufw allow 80/tcp - Check the service's bind address (should be
0.0.0.0not127.0.0.1for remote access)