0

I have successfully installed Node.JS and Balloons.IO chatroom on my linux based vps (with SSH). When typing curl http://mydomain.com:9191/ in the ssh command I can see the html is loaded. But, when trying to reach the same page from my browser it takes some time loading then says page could not be reached. Any idea why ?

6
  • Can you ping the domain from your machine (does DNS resolve)? Do firewall rules restrict that port (does the VPS allow outside traffic to access 9191)? Commented Feb 19, 2013 at 0:57
  • yes the domain itself works fine and I can see the logo I uploaded to the home page Commented Feb 19, 2013 at 1:00
  • have you tried accessing that port over the network, via something like telnet mydomain.com 9191 or using curl mydomain.com:9191 from a remote host? Commented Feb 19, 2013 at 1:02
  • curl returned curl: (7) couldn't connect to host whne using this port but loads fine without it Commented Feb 19, 2013 at 1:04
  • telnet cant open connection on this port as said Commented Feb 19, 2013 at 1:04

1 Answer 1

1

My common diagnostic steps:


1) Check that your app is actually listening on the port it should be, you can do this with:

sudo netstat -anp | grep :9191

You should see your app listening to 0.0.0.0:9191 or your.ip.address.here:9191 if you see something like 127.0.0.1:9191, then it is only listening locally so you won't be able to reach it.

2) Ensure your firewall isn't blocking these ports, if you are using iptables you can check with:

sudo iptables --list

This will print the rules for your firewall and you can check if you port is blocked (or allowed).

3) Try connecting locally. My third step is generally to try it locally with curl, you did this step already but for other landing here you can do something like:

curl http://localhost:9191/

and see what you get back

4) Try connecting remotely. If everything above looks fine, try running a verbose curl from a remote host and see what you get:

curl -v http://mydomain.com:9191/

This will show header and body output so you can see if the remote host even responds; if it doesn't then check if the raw port is even accessable with telnet:

telnet mydomain.com 9191

which if successful will print something like:

Trying your.ip.address.here...
Connected to mydomain.com.
Escape character is '^]'.

If it fails it will just hang at Trying... if it fails then your firewall is blocking the port, your host is blocking the port, or your app isn't listening to the port. If your above tests passed then contact your host because something else may be up and you should be able to get support from them.

Sign up to request clarification or add additional context in comments.

1 Comment

+1! Thank you so much! I indeed added a rule in iptables to accept the port and it works now! It was the firewall

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.