0

I'm using a yo generator (generator-moda), running on an ec2 instance, and want to navigate from my browser to the external url provided but my browser just hangs on connecting...

Are there special config adjustments that need to be done in ec2 security groups or otherwise allow the ip or host below?

    [BS] Access URLs:
 -------------------------------------
       Local: http://localhost:3000
    External: http://172.31.60.85:3000
 -------------------------------------
          UI: http://localhost:3001
 UI External: http://172.31.60.85:3001
 -------------------------------------
  [BS] Serving files from: ./app
  [17:52:19] gulp-inject 12 files into main.scss.
  [17:52:19] gulp-inject 12 files into main.scss.
[17:52:19] Starting 'html'...
[17:52:19] Finished 'html' after 3.89 ms
[BS] 1 file changed (index.html)
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
WARN [watcher]: Pattern "/home/ubuntu/dev/clients/alugha/main/app/scripts/**/*.html" does not match any file.
INFO [PhantomJS 1.9.8 (Linux)]: Connected on socket f08K4dCRmBorILmZgofR with id 91726259
irth
  • 1,618
  • 2
  • 15
  • 21
  • Just to make it clear, your are trying to connect with your browser to one of these urls: `http://172.31.60.85:3000` or `http://172.31.60.85:3001`. Right? – dgil Apr 17 '15 at 22:18
  • Yes, that is correct. When I run the server on my local machine, it's live like that but not on ec2. – irth Apr 18 '15 at 07:53

1 Answers1

4

The problem is that 172.31.0.0/16 is an Amazon's private range of IPs, so you cannot access to them outside the VPC (Amazon Virtual Private Cloud) source.

If you want to connect to your EC2 instance where your code is running you need to do two things:

  1. Connect to the public DNS hostname / IP that you can get from your EC2 console. You have the instructions here: Determining Your Public, Private, and Elastic IP Addresses - AWS docs
  2. Open the port in the security group to allow you to connect to your instance. In this answer is explained how to open a port for your security group, but instead of port 80, open 3000 and 3001.

Then in your browser copy the public DNS hostname you got on the first step with the correct port and you should be able to load your page.

Community
  • 1
  • 1
dgil
  • 2,017
  • 2
  • 21
  • 37
  • i had already adjusted the security group settings but didn't know the ec2 address plus the port was all that was necessary. Cheers, m8. – irth Apr 19 '15 at 18:38