In centos 7, configure iptables to open port 80 and centosiptables.
Centos7 uses firewalld to manage the firewall by default.
After centos7 is installed, the nginx server is installed, but the same LAN cannot be accessed. My brother told me that the Firewall should be enabled. Turn off the firewall.
Give a decisive try.
However, each firewall is always self-starting.
Then, my brother told me two options: either use firewalld for management or use iptables.
Previously, iptables was used. After the upgrade to 7, firewalld was replaced with iptables.
All I found on the Internet is to replace firewall with iptables, so I thought I would also use iptables, and there will be a lot of online prompts. Installation and configuration should not be difficult.
The following figure shows the configuration for enabling port 80 on the Internet. The save command on the third line has an error because the file does not exist.
The preceding two-line commands can only temporarily solve the problem of port 80 opening. To completely solve this problem, you need to write the configuration to the configuration file.
Find the configuration file and see that port 22 is open. Then, with a try, copy and paste the original line and Change 22 to 80,
After the system is restarted, the local network is accessible.
Then open port 3306 as shown above.