Nginx Status:
Redirecting to /bin/systemctl status nginx.service
● nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2021-11-01 21:14:06 MDT; 2s ago
Docs: http://nginx.org/en/docs/
Process: 27317 ExecStop=/bin/sh -c /bin/kill -s TERM $(/bin/cat /var/run/nginx.pid) (code=exited, status=0/SUCCESS)
Process: 27276 ExecReload=/bin/sh -c /bin/kill -s HUP $(/bin/cat /var/run/nginx.pid) (code=exited, status=0/SUCCESS)
Process: 27321 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
Main PID: 26667 (code=exited, status=0/SUCCESS)
Nov 01 21:14:03 server.sunnylab.org nginx[27321]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Nov 01 21:14:04 server.sunnylab.org nginx[27321]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Nov 01 21:14:04 server.sunnylab.org nginx[27321]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Nov 01 21:14:05 server.sunnylab.org nginx[27321]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Nov 01 21:14:05 server.sunnylab.org nginx[27321]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Nov 01 21:14:06 server.sunnylab.org nginx[27321]: nginx: [emerg] still could not bind()
Nov 01 21:14:06 server.sunnylab.org systemd[1]: nginx.service: control process exited, code=exited status=1
Nov 01 21:14:06 server.sunnylab.org systemd[1]: Failed to start nginx - high performance web server.
Nov 01 21:14:06 server.sunnylab.org systemd[1]: Unit nginx.service entered failed state.
Nov 01 21:14:06 server.sunnylab.org systemd[1]: nginx.service failed.
在配置了新的server以后,重启engintron,会出现以上错误,查端口80发现,并没有80端口被占用。
后来与之前版本对比,发现以下不同。
engintron v1.16 的default.conf

engintron v1.11 的default.conf

只需要将这部分换成老版本的配置,就可以成功重启了。
因此可能是engintron v1.16更新导致的bug。
本文记录了一次Nginx服务启动失败的问题排查过程。在更新engintron版本后,尝试重启Nginx时遇到“地址已在使用”的错误提示。通过检查端口使用情况和对比不同版本的配置文件,最终确定了问题的原因并给出了解决方案。
1万+

被折叠的 条评论
为什么被折叠?



