Linux Firewall startup and Shutdown

Source: Internet
Author: User
Article Title: linux Firewall startup and shutdown. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

I installed tomcat on the linux server yesterday. The whole process went smoothly. However, it cannot be started today. Therefore, modify the tocmat configuration file and re-

Install tomcat, modify/etc/profile, and try various possibilities several times. But tomcat is dead there. Alas ~~, Really irritating .....

It seems that you can only try the most stupid way-reinstall linux. Before I reinstall tomcat, I tried to access tomcat in the linux server and the result page came out. Obviously, tomcat

It has been started, but cannot be accessed on other machines, indicating a network error. Oh, no, the network is impossible because the server still has apache and apache

The operation is normal, and other hosts can access it. Their difference is that apache uses port 80 and tomcat uses port 8080. So I disabled apache and changed tomcat to 80.

Port to start tomcat. This time, tomcat runs normally and can be accessed by other machines in the network.

Later, I searched for information on the Internet and found that the firewall was doing something strange. It shut down many ports, but there was no such thing as 80. So I used service iptables stop to disable the firewall and then

Change the tomcat port to 8080 and start tomcat. The result is normal.

Here are the commands for starting and disabling the Firewall:

1) takes effect after restart
Enable: chkconfig iptables on
Close: chkconfig iptables off

2) takes effect immediately and becomes invalid after restart
Enable: service iptables start
Disable: service iptables stop

You can use the preceding command to enable or disable other services in Linux.

When the firewall is enabled, make the following settings to enable the relevant port, modify the/etc/sysconfig/iptables file, and add the following content:
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 22-j ACCEPT

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.