Snowcat Jung
Snowcat Jung

Reputation: 131

I cannot connect to rails server. localhost:3000

I just using AWS, EC2.

and I run server but I cannot access localhost:3000.

I tried

rails server -b0.0.0.0
rails server -b(AWS public host)

how can I access to server...??

enter image description here

Upvotes: 1

Views: 688

Answers (2)

Tom
Tom

Reputation: 2888

On your screenshot, you are not trying to reach "localhost" but your public IP. Can you try http://localhost:3000 while running rails server -b 0.0.0.0?

To access your public IP, I assume that your machine is accessible publicaly on port 22 since you ssh'd in it. So just make sure that you have opened your security group on port 3000 (and also that you don't have any DENY ACL on your subnet, but this should be OK by default if you didn't touch the ACL rules).

Upvotes: 0

bbozo
bbozo

Reputation: 7301

Yes rails server -b 0.0.0.0 is correct, you should be able to access it from the outside on port 3000 if your AWS environment is set up correctly (hint, check firewalls etc),

on the other hand, why would you use port 3000 to access an AWS hosted web service from the outside is a completely different matter

Upvotes: 2

Related Questions