nginx bind() to [::]:80 failed (98: Address already in use)的解决办法

启动nginx 报错:

nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()

出现这个错误的原因可能是有进程占用了80端口。
在终端输入:netstat -ntpl
查看是哪个程序占用了80端口,然后 killall -9 进程号
我的机子预装了apache,apache占用了80端口。
如果以后用不着apache,可以选择卸载apache。

发表评论

电子邮件地址不会被公开。 必填项已用*标注