解决办法在安装完Nginx后服务启动失败
在安裝完Nginx后服務啟動失敗的解決辦法
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. //提示信息
問題分析
然后我就按照問題提示的命令查看了一下 journalctl -xe
8月 09 00:38:21 localhost.localdomain nginx[26205]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Addre
8月 09 00:38:22 localhost.localdomain nginx[26205]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Addre
8月 09 00:38:22 localhost.localdomain nginx[26205]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Addre
8月 09 00:38:23 localhost.localdomain nginx[26205]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Addre
8月 09 00:38:23 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited stat
8月 09 00:38:23 localhost.localdomain nginx[26205]: nginx: [emerg] still could not bind()
8月 09 00:38:23 localhost.localdomain systemd[1]: Failed to start nginx.
從輸出的提示信息上可以看到”0.0.0.0:80 failed”字樣,大概可能跟端口有關,然后再使用如下命令查看一下端口進程:
通過監聽端口,發現80端口已經被占用了,怪不得Nginx服務起不來
解決辦法
[root@promote nginx-1.12.2]# killall -s QUIT nginx
重啟啟動一下nginx
總結
以上是生活随笔為你收集整理的解决办法在安装完Nginx后服务启动失败的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Nginx域名访问与访问控制
- 下一篇: Nginx优化与防盗链(隐藏版本号、配置