gitlab 安装报错无法重启nginx

重启时报错


/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)


发现没有pid没文件


/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf


执行此命令修复


又报错

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()


端口被强占

losf -i:80


查看被占端口


nginx 3274 root 6u IPv4 10664 0t0 TCP *:http (LISTEN)
nginx 3547 nginx 6u IPv4 10664 0t0 TCP *:http (LISTEN)


kill -9 进程号


成功杀死


重启!!!

不过。。。。还报错!!!他妈还报错


最后发现80端口进程杀死后,任然会重新生成,这分明是有守护进程


lsof -i:80 再次查看占用情况

[root@iz2zeb2wsie8fvxcmgisz8z /]# lsof -i:80
COMMAND PID       USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nginx   533       root    7u  IPv4  12759      0t0  TCP *:http (LISTEN)
nginx   594 gitlab-www    7u  IPv4  12759      0t0  TCP *:http (LISTEN)


594进程是gitlab的,说明这是gitlab整的


接着

停掉gitlab  

sudo gitlab-ctl stop

接着

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

然后

/usr/local/nginx/sbin/nginx -s reload

OK!!!!

Y(^o^)Y好了,搞了一上午









  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值