【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...

简介: 【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...

@[toc]

报错

Windows下启动nginx报:bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket
在这里插入图片描述

分析

查看nginx-1.19.2\logs目录下的error.log,得知报错信息为: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)按键盘win+r,输入cmd,打开管理员界面

(3)输入netstat -aon|findstr :80,找到端口号为0.0.0.0:80被占用了,查看pid值为4
在这里插入图片描述

(4)输入tasklist|findstr "4",找到4端口对应的名称,为 System

在这里插入图片描述

解决

修改nginx.conf下的默认端口号

(1)用记事本打开nginx目录下的nginx.conf文件

(2)按键盘win+r,输入cmd,打开管理员界面,输入netstat -aon|findstr :预期端口号,查看自己的预期端口号是否被占用

(3)修改nginx.conf,后保存
在这里插入图片描述

(4)在命令提示符下输入nginx -s reload即可(重要一步)

(5)然后命令提示符下输入start nginx

(6)在浏览器localhost:81,如果出现以下页面在修改成功

在这里插入图片描述

相关文章
|
1月前
|
应用服务中间件 nginx Windows
windows 安装nginx
windows 安装nginx
22 0
|
4天前
|
Windows
【Windows】 Win10下报错:该文件没有与之关联的应用来执行该操作。请安装应用,若已经安装应用,请在“默认应用设置”页面中创建关联
【Windows】 Win10下报错:该文件没有与之关联的应用来执行该操作。请安装应用,若已经安装应用,请在“默认应用设置”页面中创建关联
12 1
|
17天前
|
运维 安全 数据管理
数据管理DMS产品使用合集之windows上安装网关时,token都是新的,报错:无效的token,该怎么办
阿里云数据管理DMS提供了全面的数据管理、数据库运维、数据安全、数据迁移与同步等功能,助力企业高效、安全地进行数据库管理和运维工作。以下是DMS产品使用合集的详细介绍。
20 4
|
10天前
|
前端开发 应用服务中间件 nginx
安装Windows版nginx以及部署前端代码并就解决刷新出现404
安装Windows版nginx以及部署前端代码并就解决刷新出现404
20 0
|
2月前
|
负载均衡 应用服务中间件 nginx
解决nginx配置负载均衡时invalid host in upstream报错
在Windows环境下,配置Nginx 1.11.5进行负载均衡时遇到问题,服务无法启动。错误日志显示“invalid host in upstream”。检查发现上游服务器列表中,192.168.29.128的主机地址无效。负载均衡配置中,两个服务器地址前误加了"http://"。修正方法是删除上游服务器列表和proxy_pass中的"http://"。问题解决后,Nginx服务应能正常启动。
132 4
解决nginx配置负载均衡时invalid host in upstream报错
|
21天前
|
应用服务中间件 nginx Windows
如何优雅的安装nginx并启动--windows
如何优雅的安装nginx并启动--windows
25 0
|
1月前
|
Linux Docker Windows
windows10安装docker报错【已解决】
windows10安装docker报错【已解决】
65 0
|
1月前
|
Windows
Qtdesigner报错:This application failed to stat could not find or load the Qt platform plugin “windows“
Qtdesigner报错:This application failed to stat could not find or load the Qt platform plugin “windows“
|
1月前
|
应用服务中间件 nginx Windows
windows系统bat批处理 管理nginx启动 nginx脚本管理bat脚本管理生命周期windows一键nginx启动
windows系统bat批处理 管理nginx启动 nginx脚本管理bat脚本管理生命周期windows一键nginx启动
21 0
|
2月前
|
应用服务中间件 nginx
yum 安装报错 No package nginx available Error:Nothing to do
yum 安装报错 No package nginx available Error:Nothing to do
105 1