9

I created a new Ubuntu T2 Micro instance on EC2.

Created a new Elastic IP and selected "EIP used in: VPC"

Associated the address to my new EC2 Ubuntu instance.

I now have a Private IP and a Public/Elastic IP. No Public DNS.

My security group has SSH port 22 and HTTP port 80 open.

I can connect to the instance just fine through SSH using the Public IP, but when I try to browse to the Public IP through the browser it says connection refused. I can't ping it either.

I'm out of ideas.

helloV
  • 50,176
  • 7
  • 137
  • 145
fuzzybabybunny
  • 5,146
  • 6
  • 32
  • 58
  • 2
    In your security group, does it have port 80 open for all IPs? Also though, have you even installed a web engine on it? One is not provided by default –  Feb 16 '16 at 03:18
  • What web server are you running? Does it show up in `ps` ? – Thilo Feb 16 '16 at 03:20
  • Yeah, the web server wasn't starting. Was using a package to deploy my site that also configures and runs the web server, but that part is failing. It has to do with the package, not the EC2 instance. Thanks! – fuzzybabybunny Feb 16 '16 at 05:15

4 Answers4

11

Amazon EC2 HTTP connection refused, but HTTP port is open

That's already proven by the fact that you got 'connection refused'. If the port wasn't open it would have been 'connect timeout'.

'Connection refused' means that the service you tried to connect to wasn't listening at that port. Possibly it isn't started at all, or even installed.

user207421
  • 305,947
  • 44
  • 307
  • 483
10

You need to install a web server on your machine, such as Apache or Nginx. This is not provided by default in EC2.

  • Gotcha, thanks. I'm using MeteorJS and the `mupx` deployment package seems to be having issues with configuring the EC2 server with the web server. Looks like that's where I have to start. Thanks! – fuzzybabybunny Feb 16 '16 at 05:13
1

go to security groups --> edit inbound rules --> add rule (add a custom TCP port 8888 with 0.0.0.0/0 ).

jaswanth
  • 11
  • 2
-1

There are two major things that can happen to your web server.

Connection refused :- Which means there is no service running (http/JBOSS/nginx) on your server which is available to accept connections on port specified (which is 80 in this case)

Connection timed out :- Would mean server is not able to process any incoming connection hitting it at port 80. Once you fix the security group and your NACL (if you don't have a default one), then you need to re-check to see if it's service which is giving out the error, not to forget that the error response will change.

Abhineetraj
  • 769
  • 1
  • 5
  • 9