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

相关推荐
Elastic 中国社区官方博客4 小时前
为 Elastic Cloud Serverless 和 Elasticsearch 引入统一的 API 密钥
大数据·运维·elasticsearch·搜索引擎·云原生·serverless
Agent手记4 小时前
制造业数字化升级:生产全流程企业级智能体落地解决方案 —— 基于LLM+超自动化全栈架构的智改数转深度实战
运维·ai·架构·自动化
云安全助手5 小时前
弹性云服务器+高防IP:让DDoS攻击不再是业务“生死劫”
运维·网络·安全
深色風信子5 小时前
Docker newapi
运维·docker·容器·newapi
闫利朋7 小时前
Ubuntu 24.04 桌面安装向日葵完整指南
linux·运维·ubuntu
mfxcyh7 小时前
使用MobaXterm配置nginx
java·服务器·nginx
阿里巴巴首席技术官8 小时前
通过纯Nginx实现一个简单的文件上传功能
运维·nginx
就叫飞六吧8 小时前
Docker Hub 上主流的nginx发行
java·nginx·docker
GL_Rain8 小时前
快速搭建Halo博客 + 崩溃秒恢复方案(Docker极简部署)
运维·docker·容器
不做无法实现的梦~8 小时前
Linux 上使用 CLion 开发嵌入式,并用 Codex CLI
linux·运维·服务器