In linux, how does one modify iptables to enable port 80 in the environment where the local server is located recently? I found that the website localhost can be accessed normally, but it cannot be accessed by ip address. I often use CentOS friends, you may encounter the same problems as me. If the firewall is enabled, port 80 cannot be accessed. For more information about centos, see. Www.2cto.com often uses CentOS and 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, on the CentOS firewall configuration page, set "Security Level" to "disabled" and select "OK. after www.2cto.com restarts the computer, the CentOS firewall has opened ports 80 and 22 by default. Introduction: CentOS is a branch of the Linux family. CentOS firewall cannot be used when APACHE is installed on CENTOS of virtual machines, solution:/sbin/iptables-I input-p tcp -- dport 80-j ACCEPT/sbin/iptables-I INPUT-p tcp -- dport 22-j ACCEPT and save it: /etc/rc. d/init. d/iptables save centos 5.3 and later versions must be saved to the configuration file using service iptables save. 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: Disable the CentOS firewall and close its service. Then, you can view the CentOS Firewall Information:/etc/init. d/iptables status disable the CentOS Firewall Service:/etc/init. d/iptables stop permanently disabled? 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 deny 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:07 2001 * 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 -j ACCEPT-A RH-F Irewall-1-INPUT-p esp-j ACCEPT-A RH-Firewall-1-INPUT-p ah-j ACCEPT-A RH-Firewall-1-INPUT-d 224.0.20.- p udp-m udp -- dport 5353-j ACCEPT-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-j ACCEPT-A RH-Firewall-1-INPUT-p tcp-m state -- state NEW-m tcp -- dport 22-j ACCEPT-A RH-Firewall-1-INPUT-j REJECT -- reject-with icmp-host-prohibited COMMIT # Completed on Sat Apr 14 07:51:07 2001 additional information: the CentOS firewall configures port 80, and the content on several pages is incorrect. 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 and then save: #/etc/rc. d/init. d/iptables save and check whether there is an existing one: [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 automatically start chkconfig- -Level 2345 iptables on may be used in different versions, and all usage methods are slightly different. If you need to remotely manage mysql, use the following command to temporarily open the * Open command iptables-a input-p tcp-s xxx. xxx. xxx. xxx -- dport 3306-j ACCEPT * close command iptables-d input-p tcp-s xxx. xxx. xxx. xxx -- dport 3306-j ACCEPT