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