重启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 那就是关闭了

相关推荐
小鱼小鱼.oO3 小时前
阿里云服务器安装nginx并配置前端资源路径(前后端部署到一台服务器并成功访问)
服务器·nginx·阿里云
资讯第一线3 小时前
Windows系统工具:WinToolsPlus 之 SQL Server Suspect/质疑/置疑/可疑/单用户等 修复
运维
惊起白鸽4504 小时前
LVS负载均衡
运维·负载均衡·lvs
伤不起bb5 小时前
NoSQL 之 Redis 配置与优化
linux·运维·数据库·redis·nosql
广东数字化转型6 小时前
nginx怎么使用nginx-rtmp-module模块实现直播间功能
linux·运维·nginx
love530love6 小时前
【笔记】在 MSYS2(MINGW64)中正确安装 Rust
运维·开发语言·人工智能·windows·笔记·python·rust
啵啵学习6 小时前
Linux 里 su 和 sudo 命令这两个有什么不一样?
linux·运维·服务器·单片机·ubuntu·centos·嵌入式
数字芯片实验室7 小时前
寄存器模型生成:从手工到自动化
运维·自动化
冰橙子id7 小时前
linux——磁盘和文件系统管理
linux·运维·服务器
咕噜企业签名分发-淼淼7 小时前
应用app的服务器如何增加高并发
运维·服务器