免责声明:我有0服务器管理经验,所以请原谅我的术语和显然缺乏努力来描述这些问题。我只是不知道自己在做什么。
无论如何,我跟随这篇文章自动生成SSL证书--这是我们的任意域所需要的东西,这使我找到了这些文档来安装nginx扩展来实现这一点。我开始阅读requirements部分,并开始安装第一个部分:OpenResty,我认为它扩展了nginx模块。我遵循安装过程,运行了关闭nginx的初始命令,以便安装通过:
sudo systemctl disable nginx
sudo systemctl stop nginx安装工作进行得很顺利,但是当我试图重新启动nginx时
sudo systemctl enable nginx
sudo systemctl start nginx在最后一个命令中我得到了一个错误:
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.这是sudo 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 Fri 2020-06-19 11:50:25 UTC; 5min ago
Process: 2160 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 2157 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Jun 19 11:50:22 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:23 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:23 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:24 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:24 staging nginx[2160]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 19 11:50:25 staging nginx[2160]: nginx: [emerg] still could not bind()
Jun 19 11:50:25 staging systemd[1]: nginx.service: Control process exited, code=exited status=1
Jun 19 11:50:25 staging systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Jun 19 11:50:25 staging systemd[1]: nginx.service: Unit entered failed state.
Jun 19 11:50:25 staging systemd[1]: nginx.service: Failed with result 'exit-code'.我不知道这意味着什么,也不知道如何解决。老实说,我甚至不知道systemctl做什么。我相信这是某种服务接口,但我真的不知道。它是在设置暂存服务器时刚刚安装的。
发布于 2020-06-19 12:05:31
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)意味着仍有一个正在运行的守护进程监听端口80。您可以使用
lsof -i :80找出它是什么。停止此操作,您将能够启动nginx服务。
https://unix.stackexchange.com/questions/593813
复制相似问题