2

I am able to run node.js server on Hostmonster. When I surf to http://node.domain.com, I get the expected html output (where 'domain' is replaced with my actual domain name). Now I wish to get an expressjs server running.

After watching this tutorial for expressjs: https://www.youtube.com/watch?v=FqMIyTH9wSg, I created the exp2014 directory and files, ran the server, and successfully got the initial "Welcome to express" web page returned when I surfed from the command line with: curl http://node.domain.com:3000 from within my Hostmonster account.

The video shows how to set up an express server responding to "localhost:3000", so I adapted the url to my site, as above and ran with curl after ssh to my Hostmonster account.

However, when I try curl http://node.domain.com:3000 from outside my Hostmonster account, the curl command times out. Same thing when I try browsing from chrome or any other browser to http://node.domain.com:3000.

Why is it that the curl command runs successfully from within my Hostmonster account, but I can't browse to it from outside the account (or run the same curl command from outside the account)?

tgoneil
  • 1,522
  • 3
  • 19
  • 30
  • Did you check your server's firewall settings? – mscdex Nov 24 '14 at 03:44
  • The problem stems from the fact that I'm on a shared server, not a dedicated one, as further explained in my comment to @SO1, below. Thanks though. – tgoneil Nov 24 '14 at 18:11

1 Answers1

2

The outside world need access to your express application that is running on your Hostmonster account and in particular on port 3000.

  1. Create a DNS entry for node.domain.com pointing to your server
  2. Make sure that port 3000 is accessible for all incoming requests - this is usually done on the firewall

The cause of your error is that curl is being blocked from accessing your express application running on a specific port.

SO1

SOJ
  • 595
  • 5
  • 11
  • I do already have a DNS entry for node.domain.com. Turns out the problem is that I'm on a shared server and specific ports are blocked, unless I want to upgrade to a dedicated server. I'm marking your answer as accepted, though, since I only found this out by subsequent google searches based on the answer you gave. Thanks for your help. – tgoneil Nov 24 '14 at 18:07