centos启动Nginx提示nginx: [emerg] still could not bind()

centos启动Nginx提示nginx: [emerg] still could not bind()centos7中启动Nginx:/usr/local/nginx/sbin/nginx,提示以下内容[root@xyw-cyck-cms-3~]#/usr/local/nginx/sbin/nginxnginx:[emerg]bind()to0.0.0.0:80failed(98:Addressalreadyinuse)nginx:[emerg]bind(...

centos7中启动Nginx: /usr/local/nginx/sbin/nginx,提示以下内容

[root@xyw-cyck-cms-3 ~]# /usr/local/nginx/sbin/nginx 
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
只听到从架构师办公室传来架构君的声音:
莲子已成荷叶老。有谁来对上联或下联?

解决办法:

根据Nginx配置文件查看配置的端口(本文中使用的是80端口),然后根据端口查看端口占用情况

此代码由Java架构师必看网-架构君整理
[root@xyw-cyck-cms-3 ~]# netstat -ntlp|grep 80 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7043/nginx: worker

使用kill命令杀死占用进程,之后重新启动Nginx

kill -9 7043

 

架构君码字不易,如需转载,请注明出处:https://javajgs.com/archives/222663
0
 

发表评论