nginx启动的时刻提醒端口被占用怎样解决办法【Nginx】,nginx

Nginx 搜搜CMS网 11个月前 (11-26) 318次浏览 0个评论 扫描二维码

有时刻,能够stop的时刻封闭不到一些举行所占的端口,这个时刻启动也会报端口被占用。

nginx启动的时刻提醒端口被占用怎样解决办法【Nginx】,nginx

如下图:

[root@ZTE_OPLUS_1 nginx-1.12.0]# sh run.sh
===============================================================================
HOME=/oplusapp/PMSCMDB/ums-server/utils/nginx/nginx-1.12.0
_NGINXCMD=/oplusapp/PMSCMDB/ums-server/utils/nginx/nginx-1.12.0/sbin/nginx
===============================================================================
/oplusapp/PMSCMDB/ums-server/utils/nginx/nginx-1.12.0
@WORK_DIR@ /oplusapp/PMSCMDB/ums-server/utils/nginx/nginx-1.12.0
@C_CMD@
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
nginx: [emerg] still could not bind()

上图报443端口被占用:运用fuser -n tcp 敕令检察占用该端口的PID列表

fuser -n tcp 443

看看是什么被占用,也可以用netstat -ntpl看看谁占用,然后KILL掉占用的PID

[root@ZTE_OPLUS_1 nginx-1.12.0]# fuser -n tcp 443
443/tcp:              2330  2337  2338  2339  2340  2341

运用kill -9 PID删除历程

[root@ZTE_OPLUS_1 nginx-1.12.0]# kill -9 2330
[root@ZTE_OPLUS_1 nginx-1.12.0]# kill -9 2337
[root@ZTE_OPLUS_1 nginx-1.12.0]# kill -9 2338
[root@ZTE_OPLUS_1 nginx-1.12.0]# kill -9 2339
[root@ZTE_OPLUS_1 nginx-1.12.0]# kill -9 2340

然后启动即可

[root@ZTE_OPLUS_1 nginx-1.12.0]# sh run.sh
===============================================================================
HOME=/oplusapp/PMSCMDB/ums-server/utils/nginx/nginx-1.12.0
_NGINXCMD=/oplusapp/PMSCMDB/ums-server/utils/nginx/nginx-1.12.0/sbin/nginx
===============================================================================
/oplusapp/PMSCMDB/ums-server/utils/nginx/nginx-1.12.0
@WORK_DIR@ /oplusapp/PMSCMDB/ums-server/utils/nginx/nginx-1.12.0
@C_CMD@

更多Nginx相干技术文章,请接见Nginx运用教程栏目举行进修!

以上就是nginx启动的时刻提醒端口被占用怎样解决办法的细致内容,更多请关注ki4网别的相干文章!


版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:nginx启动的时刻提醒端口被占用怎样解决办法【Nginx】,nginx
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到