Nginx启动失败原因:
1、进入 nginx-1.12.1\logs 路径下,打开error.log文件,发现有以下错误日志
2017/09/19 11:07:26 [emerg] 5580#3332: bind() to 0.0.0.0:80 failed (10013: An
attempt was made to access a socket in a way forbidden by its access
permissions)
2017/09/19 11:09:35 [emerg] 7552#7556: bind() to 0.0.0.0:80 failed (10013: An
attempt was made to access a socket in a way forbidden by its access
permissions)
2、错误原因是绑定80端口错误,说明80端口被占用,nginx绑定失败。
解决办法:
1、kill掉占用80端口的程序,再次启动nginx
2、如若占用80端口的服务/程序不能关闭,则更改nginx监听的端口号,操作方法:打开nginx.conf文件,将监听的端口80
修改为非80短剑,重新启动即可。