8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net systemd[1]: Starting The nginx HTTP and
reverse proxy server…
8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net nginx[51106]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net nginx[51106]: nginx: [emerg] bind() to 0.0.0.0:82 failed (13: Permission denied)
8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net nginx[51106]: nginx: configuration file /etc/nginx/nginx.conf test failed
8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net systemd[1]: nginx.service: control process exited, code=exited status=1
8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net systemd[1]: Unit nginx.service entered failed state.
8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net systemd[1]: nginx.service failed.
解决方法关闭selinux
一、临时关闭
setenforce 0 ##设置SELinux 成为permissive模式
setenforce 1 ##设置SELinux 成为enforcing模式
注意:重启系统后还会开启。
二、永久关闭
1、vim /etc/selinux/config,SELINUX=disabled,然后保存退出。
2、 vim /etc/sysconfig/selinux,SELINUX=disabled,然后保存退出。
注意:如未生效重启即可
三、验证方法
输入命令:getenforce
如果输出 disabled 或 permissive 那就是关闭了
文章描述了一个关于Nginx服务器启动时遇到的权限问题,由于bind到82端口失败,经排查发现是SELinux的限制。提供了临时关闭和永久关闭SELinux的解决方法,以及验证关闭状态的步骤。
2万+

被折叠的 条评论
为什么被折叠?



