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

 在本地电脑上测试一个php整站程序,配置了vhost中conf文件后重启nginx报错:

root@ubuntu:/home/meituge
# /etc/init.d/nginx.sh
Starting php_fpm  done
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:88 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:88 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:88 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:88 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:88 failed (98: Address already in use)
[emerg]: still could not bind()

最后发现原来是nginx重复重启。自己占用了端口。 解决方法  killall -9 nginx 杀掉nginx 进程  然后重启就行了。
/etc/init.d/nginx.sh 搞定。 

点击查看原图

发表评论

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