nginx重启出现问题

来源:2-11 Nginx的目录和配置语法_默认配置与默认站点启动

叹然一笑

2018-05-06

nginx启动没有问题,kill nginx进程后再次启动也没问题。但是重启就不行。

systemctl restart nginx.service 重启时,会提示 Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

使用 nginx -tc /etc/nginx/nginx.conf  检查配置文件也没有问题。

http://img.mukewang.com/szimg/5aeedcb000014d7d04760083.jpg


systemctl status nginx.service 结果如下图:

http://img.mukewang.com/szimg/5aeedabc000171b307660452.jpg

看着好像是说nginx启动失败,但是也能按照老师的教程正常访问页面。



写回答

1回答

Jeson

2018-05-06

看看这个错误提示,说明你系统上,已经有进程在使用80端口了。

//img.mukewang.com/szimg/5aeee1090001621007560124.jpg

可以通过netstat -luntp|grep 80 执行,查看下哪个进程使用了80端口,然后执行kill对应的pid,然后再,再次启动nginx。

0
0

Nginx入门到实践-Nginx中间件应用+搭建Webserver架构

中间件、负载均衡、应用层安全防护、动静分离、Nginx+LUA开发等

4183 学习 · 908 问题

查看课程