第一步:
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
第二步:
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
第三步:
yum install -y nginx
服务启动
service nginx restart
服务关闭
service nginx stop
发现以上都很正常,然而魔鬼就藏在后面....
修改default.conf之后发现以下错误
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
发现有类似的错误,权限问题
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8091 failed (13: Permission denied)
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
第二步:
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
第三步:
yum install -y nginx
服务启动
service nginx restart
服务关闭
service nginx stop
发现以上都很正常,然而魔鬼就藏在后面....
修改default.conf之后发现以下错误
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
发现有类似的错误,权限问题
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8091 failed (13: Permission denied)
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可