首先使用SSH连接飞牛,并且进入root权限
发现端口 8000 5666 nginx 都监听着,但就是访问不了,一直转圈···
nginx error.log:
2025/02/22 22:36:39 [info] 1825#0: Cert config Array size: 2
2025/02/22 22:36:41 [emerg] 2501#0: inotify_init failed: (13: Permission denied)
2025/02/22 22:36:41 [emerg] 2502#0: inotify_init failed: (13: Permission denied)
2025/02/22 22:36:41 [emerg] 2503#0: inotify_init failed: (13: Permission denied)
2025/02/22 22:36:42 [**] 2499#0: worker process 2501 exited with fatal code 2 and cannot be respawned
2025/02/22 22:36:42 [**] 2499#0: worker process 2502 exited with fatal code 2 and cannot be respawned
2025/02/22 22:36:42 [**] 2499#0: worker process 2503 exited with fatal code 2 and cannot be respawned
2025/02/22 22:36:41 [emerg] 2504#0: inotify_init failed: (13: Permission denied)
2025/02/22 22:36:42 [**] 2499#0: worker process 2504 exited with fatal code 2 and cannot be respawned
正确解决办法使用命令:chmod o+x /usr/trim && systemctl restart trim_nginx即可解决 |
一般到上一步就可以解决了,但是有个别用户的还是无法解决?
比如:提示启动trim_nginx失败!
继续使用如下命令查看错误详情:
journalctl -xeu trim_nginx.service
░░ Support: https://www.debian.org/support
░░
░░ The unit trim_nginx.service completed and consumed the indicated resources.
Apr 02 22:24:04 chao systemd[1]: Starting trim_nginx.service - trim nginx service...
░░ Subject: A start job for unit trim_nginx.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit trim_nginx.service has begun execution.
░░
░░ The job identifier is 10921.
Apr 02 22:24:05 chao nginx[17043]: nginx: the configuration file /usr/trim/nginx/conf/nginx.conf syntax is ok
Apr 02 22:24:05 chao nginx[17043]: nginx: configuration file /usr/trim/nginx/conf/nginx.conf test is successful
Apr 02 22:24:06 chao nginx[17062]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 02 22:24:06 chao nginx[17062]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
这个日志显示trim_nginx被占用,我们可以看下哪个进程占用了nginx的80端口:
root@chao:~# lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 17725 root 16u IPv4 83382 0t0 TCP *:http (LISTEN)
nginx 17725 root 17u IPv6 83383 0t0 TCP *:http (LISTEN)
nginx 17730 www-data 16u IPv4 83382 0t0 TCP *:http (LISTEN)
nginx 17730 www-data 17u IPv6 83383 0t0 TCP *:http (LISTEN)
nginx 17731 www-data 16u IPv4 83382 0t0 TCP *:http (LISTEN)
nginx 17731 www-data 17u IPv6 83383 0t0 TCP *:http (LISTEN)
nginx 17732 www-data 16u IPv4 83382 0t0 TCP *:http (LISTEN)
nginx 17732 www-data 17u IPv6 83383 0t0 TCP *:http (LISTEN)
nginx 17733 www-data 16u IPv4 83382 0t0 TCP *:http (LISTEN)
nginx 17733 www-data 17u IPv6 83383 0t0 TCP *:http (LISTEN)
我们发现有一个nginx占用了飞牛的5666进程所在的那个nginx进程(trim_nginx),导致web页面无法访问
解决方案:直接杀死该nginx进程即可,可以使用如下命令
systemctl stop nginx
然后我们继续启动飞牛的nginx,即trim_nginx,具体命令如下:
systemctl restart trim_nginx
然后,我们发现linux命令行没有报错,刷新飞牛的web页面发现可以正常访问飞牛啦!
没有回复内容