重启nginx出现权限错误

8月 14 17:22:54 adsl-172-10-8-177.dsl.sndg02.sbcglobal.net systemd[1]: 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 那就是关闭了

相关推荐
从后端到QT26 分钟前
SRS流媒体服务器(8)源码分析之rtc/rtmp互相转码详解
运维·服务器·实时音视频
CodeWithMe29 分钟前
Nginx入门进阶:从零到高手的实战指南
运维·nginx
鹏大师运维32 分钟前
在银河麒麟V10 SP1上手动安装与配置高版本Docker的完整指南
linux·运维·docker·容器·麒麟·统信uos·中科方德
QMCY_jason35 分钟前
linux 内存占用排查 vm.nr_hugepages
linux·运维·服务器
Ahlson36 分钟前
【fnNAS】docker的nginx配置html
nginx·docker·容器·fnnas
半方白1 小时前
通过 ks.cfg 文件实现 openEuler 系统自动部署
运维·自动化运维
moppol1 小时前
容器化 vs 虚拟机:什么时候该用 Docker?什么时候必须用 VM?
运维·docker·容器
ZPC82101 小时前
ubuntu 6.8.0 安装xenomai3.3
linux·运维·ubuntu
一梦浮华2 小时前
自学嵌入式 day30 IPC:进程间通信
linux·运维·服务器
精英的英3 小时前
在Ubuntu 24.04主机上创建Ubuntu 14.04编译环境的完整指南
linux·运维·ubuntu