Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of configuring port 80 for CentOS 5.4firewall?

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

To solve this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Friends who often use CentOS may encounter the same problems as me. Recently, when I installed and configured the ORACLE database under the Linux CentOS firewall, it always showed that the EM installation failed due to the network port, so I planned to shut down the CentOS firewall first. It feels good to see the configuration instructions of CentOS firewall by chance. Execute the "setup" command to start the text mode configuration utility, select "Firewall configuration" in "Select a tool", then select "run tool" button, CentOS firewall configuration interface appears, set the "security level" to "disabled", and then select "OK".

After restarting the computer in this way, the CentOS firewall has opened ports 80 and 22 by default

Introduction: CentOS is a branch of the Linux family.

CentOS firewall installed in the CENTOS of the virtual machine APACHE can not be used, depressed, 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

Versions of centos 5.3 and above 5.4 need to be used

Service iptables save

To save to the configuration file.

After restarting the computer in this way, CentOS Firewall has opened ports 80 and 22 by default.

It should be possible not to restart the computer here:

/ etc/init.d/iptables restart

To shut down the CentOS firewall, you can simply turn off its services:

View CentOS firewall information: / etc/init.d/iptables status

Turn off the CentOS Firewall service: / etc/init.d/iptables stop

Permanently shut down? I don't know how to make it permanent:

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

This denies all access to CentOS 5.3 system data, except for the rules of Chain RH-Firewall-1-INPUT (2 references), hehe.

If you configure iptables with the command, you must need service iptables save to save it to the configuration file.

Cat / etc/sysconfig/iptables can view the contents of firewall 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]

-An 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-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.251-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

In addition:

CentOS Firewall configuration Port 80

After reading several pages, there are mistakes in the content. Here is the correct way to do it:

# / 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

Then check to see if you already have:

[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

2 ACCEPT tcp-- 0.0.0.0Universe 0 0.0.0.0Uniplex 0 tcp dpt:80

3 RH-Firewall-1-INPUT all--0.0.0.0Universe 0 0.0.0.0Universe 0

Chain FORWARD (policy ACCEPT)

Num target prot opt source destination

1 RH-Firewall-1-INPUT all--0.0.0.0Universe 0 0.0.0.0Universe 0

* set iptables to start automatically

Chkconfig-level 2345 iptables on

Perhaps because people use different versions, all the methods of use are slightly different.

This is the answer to the question about how to configure port 80 in CentOS 5.4.I hope the above content can help you to a certain extent. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report