一、概述
在使用yum安装完毕nginx后,使用 systemctl start nginx.service报如下错误:
[root@softwares ~]# systemctl start 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.
二、问题分析
看上面的报错信息,没有发现具体的错误提示,但是提示信息中提示我们使用journalctl -xe命令可以查看详细信息,于是
提示和SELinux 有关。
三、问题解决
查看SELinux 的状态
[root@softwares nginx]# getenforce
Enforcing ##启用状态
禁用SELinux
[root@softwares nginx]# setenforce 0
[root@softwares nginx]# getenforce
Permissive
配置文件也同步修改一下,防止下次重启后,如上命令配置方式失效
[root@softwares nginx]# vim /etc/selinux/config
修改:SELINUX=disable