Linux下启动Nginx时报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

简介: Linux下启动Nginx时报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

出现这种问题,多半是80端口被占用了。

先使用以下命令查看当前进程


netstat -ntlp


回车,看到结果如图:

996ad1423fbc4fb99e995d346582730c.png


可以明显看到有个进程占用了80端口。

我们可以使用kill命令将他杀掉

kill 2054


再次查看:

bf33b9e09d5544578af3345f1601dd9a.png

已经没有进程占用80端口了。

此时再次启动Nginx,启动成功 。




相关文章
|
9月前
|
应用服务中间件 网络安全 nginx
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
1545 0
|
4月前
|
网络协议 应用服务中间件 nginx
FFmpeg错误笔记(一):nginx-rtmp-module推流出现 Server error: Already publishing
这篇文章讨论了在使用nginx-rtmp-module进行RTMP推流时遇到的“Server error: Already publishing”错误,分析了错误原因,并提供了详细的解决办法,包括修改nginx配置文件和终止异常的TCP连接。
300 0
FFmpeg错误笔记(一):nginx-rtmp-module推流出现 Server error: Already publishing
|
6月前
|
存储 应用服务中间件 nginx
成功解决:nginx: [emerg] unexpected “}“ in /etc/nginx/conf.d/gulimall.conf:10
这篇文章详细介绍了Linux虚拟机磁盘空间不足时的扩容流程,从外部配置到具体扩容操作,再到验证扩容效果的步骤。同时,也探讨了Docker容器磁盘空间耗尽的问题,并提供了解决方案,包括删除无用镜像和容器,以及如何重新配置Docker的存储位置。文章还涵盖了一些意外情况的处理方法,比如误删容器后的恢复策略,并最终展示了使用Docker安装nginx并成功访问的详细过程。
成功解决:nginx: [emerg] unexpected “}“ in /etc/nginx/conf.d/gulimall.conf:10
|
6月前
|
Linux 开发工具 数据安全/隐私保护
【Deepin 20系统】Linux系统开机显示Failed to start Rotate log files
如果解决了该问题,系统仍然进不去不要惊慌,继续排查下一个错误。
153 4
|
9月前
|
应用服务中间件 nginx Docker
Docker中报错 Error response from daemon: Conflict. The container name “/nginx01“ is already in use
在尝试运行 `docker run -d --name nginx01 -p 3344:80 nginx` 时遇到错误。问题源于已有名为 nginx01 的容器未正确终止,造成命名冲突。解决方法:首先使用 `docker ps -a` 查看所有容器,然后删除现有 nginx01 容器,执行 `docker rm <container_id>`(替换 `<container_id>` 为实际容器ID),最后再运行 `docker run` 命令即可。
454 0
|
9月前
|
应用服务中间件 nginx Windows
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
331 0
|
9月前
|
应用服务中间件 网络安全 nginx
解决nginx:[emerg]unknown directive ssl错误
解决nginx:[emerg]unknown directive ssl错误
1816 0
|
9月前
|
存储 应用服务中间件 nginx
【各种问题处理】nginx报错nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
【1月更文挑战第13天】【各种问题处理】nginx报错nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
|
9月前
|
应用服务中间件 nginx C++
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
|
9月前
|
应用服务中间件 nginx
Nginx启动时提示nginx: [emerg] still could not bind()
Nginx启动时提示nginx: [emerg] still could not bind()
753 0