- Outline
- Young people to experience the first time firewalld
- background
- The first installation of apache
- Eight children of
- I had wanted to use curl got to see server
- The default port of 80 results page, there is a head, face html
- I suddenly look like a long-sawed page
- It was found that the browser does not open
- But can pass ping, ssh can pass
- So back to the old problem, the firewall and selinux
- It would have been when you plan an unhappy solution
- But think of the last thing, decided a little to see if there is no other solution
- Last casually off the firewall, resulting in a docker-cli and git do not always connect one end of the Internet ...
- The first installation of apache
- surroundings
- VM OS
- CentOS 7
- Apache
- 2.4.6-90
- Network mode
- bridging
- VM OS
1. Problem
- problem
- http server in a virtual machine, the host can not be accessed
- verification
- virtual machine
- httpd start properly
curl localhost
There can be the correct result- Verify whether to open firewalld
- I opened up this is the
- If not open, I really do not know how to do ...
- Host
- ping the virtual machine
- Browser can not access
- virtual machine
- idea
- Ah, the port out of the question
2. retarded solution: turn off the firewall
- Outline
- The most brainless solution
- But for me the last time docker do so miserable, I believed
operating
# 1. 验证 防火墙 是否打开 > systemctl status firewalld # 2. 关闭 防火墙 > systemctl stop firewalld # 3. 验证 防火墙 是否打开 > systemctl status firewalld
- result
- Firewall successfully closed
- Access the virtual machine host port 80 success
3. Conventional solution: Let firewalld open port 80
- Outline
- The normal solution
step
1. Verify whether to open firewalld
- Outline
- Be sure to open
2. Review the list of open ports of firewalld
- Outline
- View open ports
command
> firewall-cmd --list-posts
- result
- Sure enough, 80 / tcp and not therein
3. Add 80 / tcp open ports to the list
- Outline
- Adding open port
command
# 1. 添加端口 # 参数意思, 我并不是很懂 # 但是稍微有点基础的同学, 肯定能猜个 7788 # 我打算等以后正式学习 firewalld 时, 再 详细说明 > firewall-cmd --zone=public --add-port=80/tcp --permanent # 2. 重启 firewalld # 这步必须有 > firewall-cmd --reload # 3. 查看是否生效 # 80/tcp 加入了列表 > firewall-cmd --list-posts
4. Verify the host
- Outline
- Verify the host browser
- result
- I passed here
- I will not elaborate on the specific
- I passed here
ps
- ref
- other
- firewalld free look
- wirewalld and iptables
- It in fact, is a thing