title: Amazon AWS EC2 ports: connection refused
body: <p>I have just created an EC2 instance on a brand new AWS account, behind a security group, and loaded some software on it. I am running Sinatra on the machine on port 4567 (currently), and have opened that port in my security group to whole world. Further, I am able to ssh into the EC2 instance, but I cannot connect on port 4567. I am using the public IP to connect:</p>
  
  <pre><code>shakuras:~ tyler$ curl **.***.**.***:22
  SSH-2.0-OpenSSH_6.2p2 Ubuntu-6ubuntu0.1
  curl: (56) Recv failure: Connection reset by peer
  shakuras:~ tyler$ curl **.***.**.***:4567
  curl: (7) Failed connect to **.***.**.***:4567; Connection refused
  </code></pre>
  
  <p>But my webserver is running, since I can see the site when I curl from localhost:</p>
  
  <pre><code>ubuntu@ip-172-31-8-160:~$ curl localhost:4567
  Hello world! Welcome
  </code></pre>
  
  <p>I thought it might be the firewall but I ran iptables and got: </p>
  
  <pre><code>ubuntu@ip-172-31-8-160:~$ sudo iptables -L
  Chain INPUT (policy ACCEPT)
  target     prot opt source               destination         
  
  Chain FORWARD (policy ACCEPT)
  target     prot opt source               destination         
  
  Chain OUTPUT (policy ACCEPT)
  target     prot opt source               destination
  </code></pre>
  
  <p>I'm pretty lost on what is going on here. Why can't I connect from the outside world?</p>