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

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 一望无际的南

wps转PDF-解决IPAD中PDF乱码问题 thinkserver TS250 虚拟化主机部署 小微企业的数据备份方案 mac idea 修改git账号 coder,不要做计算机,好吗? mac 同一应用多实例的切换 沙雕的git Plugin 一行命令完成linux对文件的授权 jira 8.x 性能调优 NODEJS npm build 中哪些乱码是什么? DT 还是IT 混乱的docker swarm 版本在运维的重要性 bitbucket灾难恢复或者服务迁移指南 2020年服务器迁移 当,规范什么都不是 记阿里云SLB后配置Nginx反向代理百度地图API的坑 gradle介绍 Centos7 改名问题
nginx 在linux下端口被禁用问题
一望无际的南 · 2020-02-01 · via 博客园 - 一望无际的南
摘要:

ginx部署的时候主要在两种情况下会出现被禁用的情况:


跟selinux或者是firewall有关系

情况1:
nginx: [emerg] bind() to 0.0.0.0:7990 failed (13: permission denied)
这种情况是由于selinux的policy的原因被禁用的。
采用semanage工具就可以处理。

这里补充一下:当我们知道工具名称的时候,如何通过yum来查找其存在哪个包里。

如何找到某个命令在哪个安装包?

#yum provides /usr/sbin/semanage

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: fedora.cs.nctu.edu.tw
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
policycoreutils-python-2.5-33.el7.x86_64 : SELinux policy core python utilities
Repo : base
Matched from:
Filename : /usr/sbin/semanage


根据上面查询包是: policycoreutils-python
因此,安装工具

yum install policycoreutils-python

查找http port selinx的policy阻止的

#semanage port -l | grep http_port_t
http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000

增加端口:

sudo semanage port -a -t http_port_t -p tcp 7990

有点类似centos7的firewall

第二种情况就是firewall阻止了端口


查看端口:

firewall-cmd --list-ports

增加端口:
firewall-cmd --add-port=7990/tcp --zone=public --permanent

firewall-cmd --reload