If you use CentOS frequently, you may encounter the same problems as me. If the firewall is enabled, port 80 cannot be accessed. For more information about centos, see. If you use CentOS frequently, you may encounter the same problems as me. Recently, when I installed and configured the ORACLE database under the LinuxCentOS firewall, it always showed that my friends who frequently use CentOS due to network ports may encounter the same problems as me. When the firewall is enabled, port 80 cannot be accessed. CentosFor more information, see. If you use CentOS frequently, you may encounter the same problems as me. Recently, when installing and configuring the ORACLE database under the Linux CentOS firewall, the system displays that the EM installation failed due to the network port. Therefore, we plan to disable the CentOS firewall first. I accidentally saw the instructions on how to configure the CentOS firewall. Run the "setup" command to start the text mode configuration utility, select "firewall configuration" in "select a tool", and then select the "running tool" button. the CentOS firewall configuration page appears, set "security level" to "disable", and then select "OK.
After the computer is restarted, the CentOS firewall opens ports 80 and 22 by default.
Introduction: CentOS is a branch of the Linux family.
The CentOS firewall cannot be used when APACHE is installed on the CENTOS of the VM. the solution is as follows:
/Sbin/ Iptables-I INPUT-p tcp -- dport 80-j ACCEPT
/Sbin/iptables-I INPUT-p tcp -- dport 22-j ACCEPT
Then save:
/Etc/rc. d/init. d/iptables save
Centos 5.3 and later versions are required
Service iptables save
To save it to the configuration file.
After the computer is restarted, the CentOS firewall has opened ports 80 and 22 by default.
You may not restart the computer either here:
/Etc/init. d/iptables restart
Close the CentOS firewall and disable its services:
View CentOS firewall information:/etc/init. d/iptables status
Disable CentOS firewall service:/etc/init. d/iptables stop
Permanently Close? I don't know how to use the permanent method:
Chkconfig? Level 35 iptables off
The above content is for the old version of centos, and the following content is based on the new version.
Iptables-P INPUT DROP
In this way, all access to CentOS 5.3 system data, except for the Chain RH-Firewall-1-INPUT (2 references) rules, huh, huh.
After iptables is configured with a command, you must save the service iptables to the configuration file.
Cat/etc/sysconfig/iptables can view the content of the firewall's iptables configuration file
# Generated by iptables-save v1.3.5 on Sat Apr 14 07:51: 072001
* Filter
: Input drop [0: 0]
: Forward accept [0: 0]
: Output accept [1513: 149055]
: RH-Firewall-1-INPUT-[0: 0]
-A input-j RH-Firewall-1-INPUT
-A forward-j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT-I lo-j ACCEPT
-A RH-Firewall-1-INPUT-p icmp-m icmp -- icmp-type any-jACCEPT
-A RH-Firewall-1-INPUT-p esp-j ACCEPT
-A RH-Firewall-1-INPUT-p ah-j ACCEPT
-A RH-Firewall-1-INPUT-d 224.0.0.20.- p udp-m udp -- dport 5353-jACCEPT
-A RH-Firewall-1-INPUT-p udp-m udp -- dport 631-j ACCEPT
-A RH-Firewall-1-INPUT-p tcp-m tcp -- dport 631-j ACCEPT
-A RH-Firewall-1-INPUT-m state -- state RELATED, ESTABLISHED-jACCEPT
-A RH-Firewall-1-INPUT-p tcp-m state -- state NEW-m tcp -- dport22-j ACCEPT
-A RH-Firewall-1-INPUT-j REJECT -- reject-withicmp-host-prohibited
COMMIT
# Completed on Sat Apr 14 07:51:07 2001
In addition:
Configure port 80 for CentOS firewall
After reading several pages, there are errors. The following is the correct method:
#/Sbin/iptables-I INPUT-p tcp -- dport 80-j ACCEPT
#/Sbin/iptables-I INPUT-p tcp -- dport 22-j ACCEPT
Then save:
#/Etc/rc. d/init. d/iptables save
Check whether there are already:
[Root @ vcentos ~] #/Etc/init. d/iptables status
Table: filter
Chain INPUT (policy ACCEPT)
Num target prot opt source destination
1 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt: 80
2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt: 80
3 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT)
Num target prot opt source destination
1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0
* Set iptables to auto start
Chkconfig -- level 2345 iptables on
It may be because different versions are used, and all usage methods are slightly different.
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