从80改变Nginx端口

时间:2014-07-28 15:54:58

标签: nginx

我正在尝试将Nginx使用的端口从端口80更改为5555

我进入了nano /etc/nginx/sites-enabled/default 并编辑:

server {
         listen 5555;
}

但是当我尝试重新启动时,我得到:

$ 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()

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

另一项服务是港口。 使用sudo netstat -plnt查看正在使用该端口的服务并将其停止,否则进行配置。

另请查看thisthis