gpt4 book ai didi

Nginx:无法启动高性能Web服务器和反向代理服务器

转载 作者:行者123 更新时间:2023-12-04 00:34:13 25 4
gpt4 key购买 nike

我尝试启动此服务,但我不能,出现以下错误:

root@zabbix:/home/appliance# systemctl status nginx.service

nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2018-07-25 18:33:26 UTC; 1min 27s ago
Process: 30040 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 30037 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Jul 25 18:33:25 zabbix nginx[30040]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
Jul 25 18:33:25 zabbix nginx[30040]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Jul 25 18:33:25 zabbix nginx[30040]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
Jul 25 18:33:26 zabbix nginx[30040]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Jul 25 18:33:26 zabbix nginx[30040]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
Jul 25 18:33:26 zabbix nginx[30040]: nginx: [emerg] still could not bind()
Jul 25 18:33:26 zabbix systemd[1]: nginx.service: Control process exited, code=exited status=1

Jul 25 18:33:26 zabbix systemd[1]: *******Failed to start A high performance web server*** and a reverse proxy server.****

Jul 25 18:33:26 zabbix systemd[1]: nginx.service: Unit entered failed state.
Jul 25 18:33:26 zabbix systemd[1]: nginx.service: Failed with result 'exit-code'.

最佳答案

您已经有一个进程绑定(bind)到 HTTP 端口 80 . (特别是升级系统后!默认启动apache2)
所以首先试试这个:

sudo service apache2 stop
如果问题未解决,则运行此命令 sudo lsof -i:80 获取使用端口的进程列表,然后 停止或禁用 网络服务器。
尝试使用以下命令停止使用端口 80 的进程:
sudo fuser -k 80/tcp
在某些情况下,可能是配置文件中的一些问题。
您可以使用 nginx -t -c /etc/nginx/nginx.conf命令以查找任何未配置的配置。
在某些情况下,此错误是由端口 80 上的默认 Nginx 站点引起的。如果您不需要默认配置,则删除默认配置有效!
sudo rm /etc/nginx/sites-enabled/default
sudo service nginx restart

关于Nginx:无法启动高性能Web服务器和反向代理服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51525710/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com