【发布时间】:2016-11-03 18:55:18
【问题描述】:
我在远程服务器上安装了 nginx,但我在 nginx.conf 文件中出现了一些错误,无法恢复
所以它试图删除我的 nginx 并重新配置它
所以我使用链接中给出的这些步骤来删除我的 nginx
http://www.ehowstuff.com/how-to-remove-uninstall-nginx-on-centos-7-rhel-7-oracle-linux-7/
然后我使用
yum remove nginx 并再次重新安装它
但是当我尝试
sudo systemctl start nginx 或 [root@lotto nginx]# service nginx start
它显示
nginx.service 的作业失败,因为控制进程 exitenter code hereed 带有错误代码。详见“systemctl status nginx.service”和“journalctl -xe”。
当我使用
[root@lotto nginx]# systemctl status nginx.service
显示
nginx.service - nginx HTTP 和反向代理服务器
已加载:已加载(/usr/lib/systemd/system/nginx.service;已启用;供应商预设:已禁用)
活动:自美国东部时间周五 2016 年 7 月 1 日 07:48:44 以来失败(结果:退出代码); 18 岁前
进程:30832 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
进程:30830 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
主 PID:14307(code=exited,status=0/SUCCESS)
Jul 01 07:48:44 lotto systemd[1]: 启动 nginx HTTP 和反向代理服务器...
7 月 1 日 07:48:44 乐透 nginx[30832]: nginx: [emerg] getpwnam("nginx") 在 /etc/nginx/nginx.conf:5 中失败
Jul 01 07:48:44 lotto nginx[30832]: nginx: 配置文件 /etc/nginx/nginx.conf 测试失败
Jul 01 07:48:44 lotto systemd[1]: nginx.service: 控制进程退出,code=exited status=1
Jul 01 07:48:44 lotto systemd[1]: 无法启动 nginx HTTP 和反向代理服务器。
Jul 01 07:48:44 lotto systemd[1]: 单元 nginx.service 进入失败状态。
7 月 1 日 07:48:44 乐透 systemd[1]: nginx.service 失败。
和 [root@lotto nginx]# journalctl -xe
nginx.service - nginx HTTP 和反向代理服务器
已加载:已加载(/usr/lib/systemd/system/nginx.service;已启用;供应商预设:已禁用)
活动:自美国东部时间周五 2016 年 7 月 1 日 07:48:44 以来失败(结果:退出代码); 18 年前
进程:30832 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
进程:30830 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
主 PID:14307(code=exited,status=0/SUCCESS)
【问题讨论】: