CentOS closes SELINUX and opens ports 80 and 3306

Source: Internet
Author: User
Open port 80 and Port 3306 vim/etc/sysconfig/iptables add the following code under the rule of port 22 by default (you can add more and modify the port number) #/sbin/iptables-IINPUT-ptcp -- dport80-jACCEPT #/sbin/iptables-IINPUT-ptcp -- dport3306-jACCE open port 80, 3306
Vim/etc/sysconfig/iptables add the following code under the rule of port 22 by default (you can continue to add and modify the port number) #/sbin/iptables-I input-p tcp -- dport 80-j ACCEPT #/sbin/iptables-I INPUT-p tcp -- dport 3306-j ACCEPT and save it, restart the firewall to make the configuration take effect/etc/init. d/iptables restartshutdown-r now # restart the system to view the opened port/etc/init. d/iptables status -------------- add ----------------- # Disable the firewall/etc/init. d/iptables stop # stop service iptables stop # View firewall information/etc/init. d/iptables status
Disable SELINUX
Vim/etc/selinux/config # SELINUX = enforcing # Comment out # SELINUXTYPE = targeted # Comment out SELINUX = disabled # Add: wq! # Save and exit shutdown-r now # restart the system
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.