Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening port 3000 EC2 Amazon web services

I am trying to use nodejs and socket.io to deliver a webapp, which use websocket on port 3000.

I have opened port 3000 on my EC2 instance in my management console by adding the inbound TCP rule to the relevant security group, however I still can't access it via public dns on my browser.

sudo netstat -tulpn doesn't show it as an open port.

What am I missing? Is there some service I need to restart or a command line I need to push to get it running?

Thanks

like image 435
alias51 Avatar asked Oct 12 '13 17:10

alias51


1 Answers

sudo netstat -tulpn doesn't show it as an open port.

netstat command will show what all ports that are being listened by "some" process. So in this case as you have mentioned, It seems like you application is not listening on port 3000.

First, fix your application and ensure that it is listening on port 3000.

Also, netstat has nothing to do with whether a port is opend/closed from firewall perspective. It will tell you whether a given port is in LISTENING mode by some process.

Follow these steps:

  1. Make sure your application is listening on port 3000: netstat -anp | grep 3000 also telnet 127.0.0.1 3000
  2. Then make sure that local firewall is configured to allow incoming access to port 3000 OR disable local firewall to do a quick test (service iptables stop). for linux, its usually iptables
  3. Allow incoming access to port 3000 in your AWS security group.

Please follow above 3 points and let us know if you still face the same issue.

like image 177
slayedbylucifer Avatar answered Sep 28 '22 09:09

slayedbylucifer