重启时报错
/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好了,搞了一上午