欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

windows中nginx启动报bind() to 0.0.0.0:80 failed(An attempt was made to access a socket in a way forbid)

程序员文章站 2024-03-21 18:03:16
...

今天在启动nginx时,发现启动后在进程中没有nginx的进程,查看日志发现错误日志:

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)

根据日志内容,判断可能是80端口被占用了,于是使用netstat -aon | findstr :80查看80所属的pid号:
windows中nginx启动报bind() to 0.0.0.0:80 failed(An attempt was made to access a socket in a way forbid)
发现pid为5204,根据5204查看使用的是那个服务tasklist|findstr "5204"
windows中nginx启动报bind() to 0.0.0.0:80 failed(An attempt was made to access a socket in a way forbid)
我这里是解决后的,所以占用的为nginx.exe。正常情况,直接找到占用的那个服务(多为apache服务),判断其没用后,将其关闭掉。第一次我这里显示的是system,看到这个后,我没敢关闭。后来想到iis,这个是在更新后,他会强行将网络端口改为80。于是修改iis的网络端口号。

修改IIS

1.打开控制面板->管理工具,选择Internet Information Services。
windows中nginx启动报bind() to 0.0.0.0:80 failed(An attempt was made to access a socket in a way forbid)
2.点击网站,查看是否需要修改绑定的端口
windows中nginx启动报bind() to 0.0.0.0:80 failed(An attempt was made to access a socket in a way forbid)