惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
H
Heimdal Security Blog
Jina AI
Jina AI
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
AWS News Blog
AWS News Blog
C
Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Hacker News
The Hacker News
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
S
Securelist
P
Privacy International News Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 聂微东
博客园 - 叶小钗
J
Java Code Geeks
V
V2EX
博客园 - Franky
Spread Privacy
Spread Privacy
K
Kaspersky official blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
C
CERT Recently Published Vulnerability Notes
Latest news
Latest news
NISL@THU
NISL@THU
罗磊的独立博客
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
V
Visual Studio Blog

问题库系列 on 打工人日志

k8s master 节点 Unauthorized kindle 邮件发送失败,错误代码E999 linux服务器进程打开文件过多导致服务异常 解决Elasticsearch索引只读(read-only) Linux 系统收包流程以及内核参数优化 Vue3 + vite + nginx项目部署后404问题 使用scrapy-redis实现增量爬取 Chrome浏览器启动参数大全(命令行参数) Jenkins 编译Android apk 流水线 Nexus3 使用和部署 githubAction set-output弃用错误 k8s CNI 问题 连接认证失效 k8s.gcr.io国内无法连接解决方法 K8S 问题排查:cgroup 内存泄露问题 docker 问题处理 shell 脚本(1) Maven 安装编译 Nodejs 安装编译 ruoyi-cloud docker部署 安装 docker 出现 ERROR: Unsupported distribution 'ol' 问题
SELinux 问题:导致端口无法创建,无法访问
2024-08-02 · via 问题库系列 on 打工人日志

背景

今天有同事在使用nginx部署一个服务,部署完成后发现无法访问,nginx创建端口无法创建,无法访问
nginx-error

nginx: [emerg] bind() to 0.0.0.0:8081 failed (13: Permission denied)

解决方法

查看日志发现是SELinux导致的,SELinux是Linux系统的安全机制,它会限制进程访问文件和网络端口等资源。
查看SELinux状态

当 SELinux 处于 enforcing 模式时,会阻止进程访问不允许的资源。有三种方法可以解决

1. 临时关闭SELinux

2. 永久关闭SELinux

1sudo vim /etc/selinux/config
2# 修改SELINUX=enforcing 为 SELINUX=disabled

重启服务器

3. 设置为宽容模式

1semanage permissive -a http_port_t

这个命令会将 http_port_t 类型的端口设置为宽容模式(permissive mode),使得 semanage 不再对该类型的端口进行访问控制。

总结

SELinux 是 Linux 系统的安全机制,它会限制进程访问文件和网络端口等资源。在使用 SELinux 时,需要根据实际情况选择合适的解决方案。