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

推荐订阅源

雷峰网
雷峰网
Recorded Future
Recorded Future
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
GbyAI
GbyAI
IT之家
IT之家
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
S
SegmentFault 最新的问题
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
The Cloudflare Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
腾讯CDC
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
aimingoo的专栏
aimingoo的专栏
博客园 - Franky
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
月光博客
月光博客
博客园_首页
C
Check Point Blog
宝玉的分享
宝玉的分享
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Tenable Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Security Latest
Security Latest
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
阮一峰的网络日志
阮一峰的网络日志
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google Online Security Blog
Google Online Security Blog
N
News and Events Feed by Topic
Y
Y Combinator Blog
U
Unit 42
The Register - Security
The Register - Security
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
Jina AI
Jina AI

问题库系列 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 时,需要根据实际情况选择合适的解决方案。