In centos 7, configure iptables to open port 80 and centosiptables.

Source: Internet
Author: User

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.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.