【发布时间】:2018-09-10 09:52:05
【问题描述】:
我在我的机器上安装了nginx,它安装正确,但无法在我的机器上启动nginx,每当我尝试启动nginx 时,它都会显示下面我提到的错误。
每当我运行命令systemctl restart nginx && systemctl status nginx
我收到错误消息:
`Job for nginx.service failed because the control process exited with
error code.See "systemctl status nginx.service" and "journalctl -
xe" for details.`
执行命令后:systemctl status nginx.service
产生以下输出:
`nginx.service - The NGINX HTTP and reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; disabled; vendor
preset: e Active: failed (Result: exit-code) since Mon 2018-09-10
14:57:14 IST;32s ago Process: 6321 ExecStartPre=/usr/sbin/nginx -t
(code=exited ,status=203/EXEC)`
`Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: Starting The NGINX HTT
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: nginx.service: Control
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: Failed to start The NG
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: nginx.service: Unit en
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: nginx.service: Failed`
执行命令后:
journalctl -xe ,输出类型为:
`-- Unit nginx.service has begun starting up.
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC
systemd[6321]:nginx.service: Fail
-- Subject: Process /usr/sbin/nginx could not be executed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The process /usr/sbin/nginx could not be executed and failed.
--
-- The error number returned by this process is 2.
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]:
nginx.service:
Control
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: Failed to
start The NG
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit nginx.service has failed.
--
-- The result is failed.
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]: nginx.service: Unit en
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC systemd[1]:nginx.service: Failed
Sep 10 14:57:14 hk-HP-Pavilion-15-Notebook-PC polkitd(authority=local) [751]: Unr
Sep 10 14:57:46 hk-HP-Pavilion-15-Notebook-PC systemd[1] Configuration file /li
Sep 10 14:57:46 hk-HP-Pavilion-15-Notebook-PC systemd[1]:Configuration file /li`
为此搜索解决方案,但没有找到任何解决方案。任何帮助将不胜感激。
错误日志:
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to 0.0.0.0:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: bind() to [::]:80 failed (98: Address already in use)
2018/09/10 15:50:47 [emerg] 7972#7972: still could not bind()
【问题讨论】:
-
是否有
nginx错误日志? -
在上面发布了错误。
标签: nginx rtmp live-streaming systemctl