问题: html
nginx 开不了…… 发现80端口被占用。nginx
C:\WINDOWS\system32>netstat -nao|find ":80"shell
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4数据库
解决办法:windows
HTTP 服务状态快照(服务器会话视图): ----------------------------------------------------- 服务器会话 ID: FF00000120000001 版本: 2.0 状态: Active 属性: 最大带宽: 4294967295 超时: 实体正文超时(秒): 120 耗尽实体正文超时(秒): 120 请求队列超时(秒): 65535 空闲链接超时(秒): 120 标头等待超时(秒): 120 最小发送速率(字节/秒): 240 URL 组: URL 组 ID: FE00000140000001 状态: Active 请求队列名称: DefaultAppPool 属性: 最大带宽: 已继承 最大链接: 4294967295 超时: 实体正文超时(秒): 120 耗尽实体正文超时(秒): 120 请求队列超时(秒): 65535 空闲链接超时(秒): 120 标头等待超时(秒): 0 最小发送速率(字节/秒): 0 日志记录信息: 日志目录: C:\inetpub\logs\LogFiles\W3SVC1 日志格式: 0 身份验证配置: 启用的身份验证方案: 已注册的 URL 数目: 1 已注册的 URL 数目: HTTP://*:80/ 请求队列: 请求队列名称: DefaultAppPool 版本: 2.0 状态: Active 请求队列 503 详细级别: 受限的 最大请求数目: 1000 附加活动进程数目: 0 控制器进程 ID: 3112 进程 ID: C:\WINDOWS\system32>sc config http stat 描述: 在注册表和服务数据库中修改服务项。 用法: sc <server> config [service name] <option1> <option2>... 选项: 注意: 选项名称包括等号。 等号和值之间须要一个空格。 type= <own|share|interact|kernel|filesys|rec|adapt|userown|usershare> start= <boot|system|auto|demand|disabled|delayed-auto> error= <normal|severe|critical|ignore> binPath= <.exe 文件的 BinaryPathName> group= <LoadOrderGroup> tag= <yes|no> depend= <依存关系(以 / (斜杠)分隔)> obj= <AccountName|ObjectName> DisplayName= <显示名称> password= <密码> C:\WINDOWS\system32>sc config http stat = demand 描述: 在注册表和服务数据库中修改服务项。 用法: sc <server> config [service name] <option1> <option2>... 选项: 注意: 选项名称包括等号。 等号和值之间须要一个空格。 type= <own|share|interact|kernel|filesys|rec|adapt|userown|usershare> start= <boot|system|auto|demand|disabled|delayed-auto> error= <normal|severe|critical|ignore> binPath= <.exe 文件的 BinaryPathName> group= <LoadOrderGroup> tag= <yes|no> depend= <依存关系(以 / (斜杠)分隔)> obj= <AccountName|ObjectName> DisplayName= <显示名称> password= <密码> C:\WINDOWS\system32>net stop http 下面的服务依赖于 HTTP Service 服务。 中止 HTTP Service 服务也会中止这些服务。 World Wide Web Publishing Service SSDP Discovery Print Spooler 你想继续此操做吗? (Y/N) [N]: y 发生系统错误 5。 拒绝访问。
由此看出,多是http相关服务在捣鬼。服务器
到 服务 里面查看这几个http相关的,尤为是ide
World Wide Web Publishing Service
一看,果真是自动启动的,关掉,并设置为手动。日志
再执行 code
>netstat -nao |find ":80" TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING 2532 TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 2532 >nginx.exe -t nginx: the configuration file D:\GeekSoftware\nginx-1.8.0/conf/nginx.conf syntax is ok nginx: configuration file D:\GeekSoftware\nginx-1.8.0/conf/nginx.conf test is successful
OK ,nginx能够正常运行,80端口占用解除!orm
参考: http://superuser.com/questions/352017/pid4-using-port-80
其余:
http://stackoverflow.com/questions/788348/how-do-i-free-my-port-80-on-localhost-windows
https://technet.microsoft.com/en-us/library/cc725882(v=ws.10).aspx#BKMK_11
https://technet.microsoft.com/en-us/library/cc736564(v=ws.10).aspx
http://www.tenforums.com/tutorials/4499-services-start-stop-disable-windows-10-a.html