- 注册时间
- 2012-11-28
- 最后登录
- 2021-2-12
- 阅读权限
- 200
- 积分
- 3774
- 精华
- 0
- 帖子
- 116
  
ta_mind | mb_qb7 2013-3-19 01:56 |
---|
classn_01: 366 classn_02 [LV.9]以坛为家II
|
启动window上的nginx总是报错,具体日志信息如下:
E:\other\nginx-1.8.1>nginx.exe
nginx: [emerg] bind() to 0.0.0.0:443 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
原因是因为 nginx listen的443端口被占用导致无法成功启动nginx服务器。
具体解决方法
执行CMD命令netstat -aon|findstr "443",查看端口使用情况如下:
E:\other\nginx-1.8.1>netstat -aon|findstr "443"
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 4936 TCP 0.0.0.0:8443 0.0.0.0:0 LISTENING 11076 TCP 10.10.0.103:49975 123.151.76.46:443 CLOSE_WAIT 10128 TCP 10.10.0.103:52023 111.221.29.149:443 ESTABLISHED 8572 TCP 10.10.0.103:56193 61.135.169.125:443 TIME_WAIT 0 TCP 10.10.0.103:56195 61.135.169.125:443 ESTABLISHED 17396 TCP 10.10.0.103:56198 61.135.169.125:443 ESTABLISHED 17396 TCP 10.10.0.103:56200 61.135.169.125:443 ESTABLISHED 17396 TCP 10.10.0.103:56234 123.125.110.21:443 ESTABLISHED 17396 TCP 10.10.0.103:56239 101.201.169.146:443 ESTABLISHED 17396 TCP 10.10.0.103:56306 111.206.76.49:443 ESTABLISHED 17396 TCP 10.10.0.103:56307 111.206.76.49:443 ESTABLISHED 17396 TCP 10.10.0.103:56308 111.206.76.49:443 ESTABLISHED 17396 TCP 10.10.0.103:56309 123.125.115.164:443 CLOSE_WAIT 17396 TCP 10.10.0.103:56310 123.125.115.164:443 ESTABLISHED 17396 TCP 10.10.0.103:60740 123.151.76.110:443 CLOSE_WAIT 10128 TCP [::]:443 [::]:0 LISTENING 4936 TCP [::]:8443 [::]:0 LISTENING 11076
强制终止进程,执行CMD命令taskkill /F /pid 端口号,如下代码:
E:\other\nginx-1.8.1>taskkill /F /pid 1408
重新启动 nginx 服务即可。
|
|