windows下启动1.8.0版本nginx,显示如下错误:
1 2015/08/06 17:23:25 [emerg] 7220#6900: 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)
在cmd窗口运行如下命令:
1 D:Program Files ginx>netstat -aon | findstr :80 2 TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4 3 TCP [::]:80 [::]:0 LISTENING 4 4 TCP [::1]:80 [::1]:53034 ESTABLISHED 4 5 TCP [::1]:80 [::1]:53035 TIME_WAIT 0 6 TCP [::1]:53034 [::1]:80 ESTABLISHED 8776
看到80端口果真被占用。发现占用的pid是4,名字是System。怎么禁用呢?
1、打开注册表:regedit
2、找到:HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesHTTP
3、找到一个REG_DWORD类型的项Start,将其改为0
4、重启系统,System进程不会占用80端口
重启之后,start nginx.exe 。