1

Im trying to change the port that Nginx uses from port 80 to 5555

I've gone into nano /etc/nginx/sites-enabled/default and edited:

server {
         listen 5555;
}

But when I try to restart I get:

$ service nginx restart
Restarting nginx: nginx.
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()

Am I missing something?

user3490755
  • 955
  • 2
  • 15
  • 33

1 Answers1

0

Another service is the port. Use sudo netstat -plnt to see which service is using the port and stop it, or configure it otherwise.

Also check out this and this.

Community
  • 1
  • 1
Dominik Antal
  • 3,281
  • 4
  • 34
  • 50