Nginx nginx: [emerg] bind() to 0.0.0.0:8083 failed (48: Address already in use)

简介: Nginx nginx: [emerg] bind() to 0.0.0.0:8083 failed (48: Address already in use)
+关注继续查看

  • 启动 Nginx 报错:nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
  • 原因是端口 8080 被使用了,需要换个端口,或者停用掉之前的 8080 端口在重新启用服务器。

Mac 系统


  • 方式一:Nginx 将占用的端口换成别的端口
  • 方式二:通过命令查看是什么程序占用 8080 端口
$ sudo lsof -i tcp:8080
dengzemiaodeMacBook-Pro:~ dengzemiao$ sudo lsof -i tcp:8080
COMMAND    PID       USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Google     391 dengzemiao   24u  IPv4 0xac798c597943e7a7      0t0  TCP localhost:55756->localhost:http-alt (ESTABLISHED)
Google     391 dengzemiao   27u  IPv4 0xac798c5982fee7a7      0t0  TCP 10.0.91.252:55757->10.0.91.252:http-alt (ESTABLISHED)
Google     391 dengzemiao   37u  IPv4 0xac798c5982f327a7      0t0  TCP localhost:60006->localhost:http-alt (ESTABLISHED)
Google     391 dengzemiao   46u  IPv4 0xac798c597b415127      0t0  TCP localhost:61210->localhost:http-alt (ESTABLISHED)
QQ         722 dengzemiao   14u  IPv4 0xac798c5982f50127      0t0  TCP 10.0.91.252:53674->153.3.50.86:http-alt (ESTABLISHED)
QQ         722 dengzemiao   16u  IPv4 0xac798c5982f50127      0t0  TCP 10.0.91.252:53674->153.3.50.86:http-alt (ESTABLISHED)
node      4074 dengzemiao   25u  IPv4 0xac798c5984169da7      0t0  TCP *:http-alt (LISTEN)
node      4074 dengzemiao   47u  IPv4 0xac798c5982ff0427      0t0  TCP localhost:http-alt->localhost:60006 (ESTABLISHED)
node      4074 dengzemiao   48u  IPv4 0xac798c5978f5f127      0t0  TCP localhost:http-alt->localhost:61210 (ESTABLISHED)
node      4074 dengzemiao   54u  IPv4 0xac798c598003caa7      0t0  TCP localhost:http-alt->localhost:55756 (ESTABLISHED)
node      4074 dengzemiao   55u  IPv4 0xac798c5978f627a7      0t0  TCP 10.0.91.252:http-alt->10.0.91.252:55757 (ESTABLISHED)

输出发现有 GoogleQQnode 占用着 8080 端口。

如果不是什么特殊的程序,直接通过命令移除一下

$ sudo kill PID
例如:
$ sudo kill 391
也可以同时清理多个PID:
$ sudo kill 391 722 4074

移除之后在运行 $ nginx 再次启动,如果有特殊软件或者不知道该不该关,那就 nginx 先换个端口用也一样。


相关文章
|
9天前
|
网络协议 NoSQL Redis
解决 Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use
解决 Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use
15 0
|
10天前
Error: listen EADDRINUSE: address already in use :::5000
Error: listen EADDRINUSE: address already in use :::5000
|
2月前
|
应用服务中间件 网络安全 nginx
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
|
2月前
|
应用服务中间件 nginx
【Nginx异常】[error] 4236#29900: OpenEvent(“Global\ngx_reload_27128“) failed (5: Access is denied)
【Nginx异常】[error] 4236#29900: OpenEvent(“Global\ngx_reload_27128“) failed (5: Access is denied)
60 0
|
4月前
|
机器学习/深度学习 网络协议 决策智能
ubuntu16.04中 启动 Error starting userland proxy: listen tcp 0.0.0.0:5900: bind: address already in use
ubuntu16.04中 启动 Error starting userland proxy: listen tcp 0.0.0.0:5900: bind: address already in use
|
10月前
|
应用服务中间件 Linux nginx
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)
307 0
Linux下启动Nginx时报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
|
11月前
|
应用服务中间件 nginx
【已解决】nginx: [warn] conflicting server name “www.xxx.com“ on 0.0.0.0:443, ignored
nginx: [warn] conflicting server name “www.xxx.com“ on 0.0.0.0:443, ignored
311 0
|
应用服务中间件 网络安全 nginx
Nginx - 配置 SSL 报错 nginx: [emerg] unknown directive “ssl“
Nginx - 配置 SSL 报错 nginx: [emerg] unknown directive “ssl“
184 0
Nginx - 配置 SSL 报错 nginx: [emerg] unknown directive “ssl“
|
应用服务中间件 nginx
启动nginx报错,80 failed (97: Address family not supported by protocol)
启动nginx报错,80 failed (97: Address family not supported by protocol)
292 0
启动nginx报错,80 failed (97: Address family not supported by protocol)
|
应用服务中间件 网络安全 nginx
nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.con
[root@jiaxin-ceshi ca]# nginx -t nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.
7226 0