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