I'm running a node.js webserver on an Amazon Linux EC2, but I can't listen on port 80 because there's an nginx server listening on that port:
[ec2-user@ip-172-31-39-178 server]$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:6666 0.0.0.0:* LISTEN 934/pm2
tcp 0 0 127.0.0.1:6667 0.0.0.0:* LISTEN 934/pm2
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 27324/nginx
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1211/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1251/sendmail
tcp 0 0 :::22 :::* LISTEN 1211/sshd
udp 0 0 0.0.0.0:68 0.0.0.0:* 971/dhclient
udp 0 0 172.31.39.178:123 0.0.0.0:* 1236/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 1236/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 1236/ntpd
[ec2-user@ip-172-31-39-178 server]$
I don't know if I should just delete nginx (Not sure where to find it, if I were to try), or turn it off, or something like that. I don't use an nginx web-server, I guess it came packaged with the Amazon EC2.
I tried this, but it didn't work:
sudo rm -f -R /usr/local/nginx && rm -f /usr/local/sbin/nginx