重启nginx出现权限错误

8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net systemd1: Starting The nginx HTTP and

bash 复制代码
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 那就是关闭了

相关推荐
元Y亨H1 小时前
生产环境监控与故障应急处理(5-5-5 标准)指南
运维
观山岳五楼2 小时前
Ubuntu 24 怎么使用Ubuntu 20 的镜像源
linux·运维·ubuntu
寒晓星3 小时前
[linux]线程及多线程
linux·运维
慧一居士4 小时前
Linux如何设置固定的静态ip
运维
国服第二切图仔5 小时前
13其他工具 - Skill/LSP/Sleep等
linux·运维·里氏替换原则
暴力求解6 小时前
Linux ---线程控制(二)
linux·运维·服务器·操作系统
梦痕长情6 小时前
等保三级三权账户
linux·运维·服务器
jiecy7 小时前
为Linux系统双网卡配置静态路由
linux·运维
weixin_307779138 小时前
Linux下Jenkins数据故障的系统化排查Shell脚本
linux·运维·服务器·jenkins
荒--8 小时前
Burp Suite(二)
linux·运维·服务器