Nginx started but port 80 is not in use (according to netstat) on AWS

I am running an Ubuntu 14 server. I have an nginx server listening on port 80. It starts up and works fine, and I know this because it worked before. It seems to me that something related to Amazon web services changed my firewall. The server was started, but now when it directs the browser to the server's public DNS or IP, it responds this webpage is not available

. I ran sudo netstat -antp

and this was the result:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      941/sshd
tcp        0      0 172.31.28.156:22        24.78.205.33:9738       ESTABLISHED 1663/sshd: ubuntu [
tcp        0    340 172.31.28.156:22        24.78.205.33:10419      ESTABLISHED 1796/sshd: ubuntu [
tcp6       0      0 :::22                   :::*                    LISTEN      941/sshd

      

I know there must be a port open for nginx. What's going on here? Is this a firewall issue? This is a difficult problem for me because I don't even know the correct terminology for this problem. Thank you.

+3


source to share


1 answer


Here are some troubleshooting tips:

Make sure you are root first (this will save you some time)

$ sudo su

Then see if nginx reports that it is bothering:

# service nginx status
# nginx -t

      

This should tell you about the problem. If not, do the following:

# service nginx start
# tail /var/log/nginx/error.log 

      



and it will

This is usually an error in the config file, but in your case, it is likely that some other service binds one of the ports that nginx is configured to use. Typically this port is 80 and port 8080 ... so find the service:

# netstat -lnp | grep -E '80|8080' 

      

and act accordingly:

# service apache2 stop
# apt-get remove tomcat7 

      

^ But you will need to deal with these last two ...

+2


source







All Articles