我的服务器运行良好...直到重新启动,重新启动 Nginx 后运行不正常!
操作系统:Ubuntu服务器
nginx版本:nginx/1.10.0(Ubuntu)
HHVM 脚本服务器
我尝试了很多方法,但我无法解决这个问题:
配置已经OK。
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Aug 06 16:05:48 HHVM systemd[1]: Starting A high performance web server and a reverse proxy server...
-- Subject: Unit nginx.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nginx.service has begun starting up.
Aug 06 16:05:48 HHVM nginx[1618]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Aug 06 16:05:49 HHVM nginx[1618]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Aug 06 16:05:49 HHVM nginx[1618]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Aug 06 16:05:50 HHVM nginx[1618]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Aug 06 16:05:50 HHVM nginx[1618]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Aug 06 16:05:51 HHVM nginx[1618]: nginx: [emerg] still could not bind()
Aug 06 16:05:51 HHVM systemd[1]: nginx.service: Control process exited, code=exited status=1
Aug 06 16:05:51 HHVM systemd[1]: Failed to start A high performance web server and a reverse proxy server.
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nginx.service has failed.
--
-- The result is failed.
Aug 06 16:05:51 HHVM systemd[1]: nginx.service: Unit entered failed state.
Aug 06 16:05:51 HHVM systemd[1]: nginx.service: Failed with result 'exit-code'.
NginX 运行,我在 Web 浏览器上看到“404 File Not Found”,这意味着 hhvm 没有运行。
我该如何解决?
首先你需要找到
pid
ofnginx
以便你可以杀死它。要查找pid
只需键入找到 后
pid
,您可以像这样终止该进程。但最简单的方法是使用以下命令重新启动它:
或者
如果您需要更多帮助,请告诉我。
您需要检查哪个进程正在侦听端口 80,并确保在 systemd 中禁用了该服务。您可以使用命令找到进程,
netstat -lnp
在输出中查找端口 80。