Installing the Tomcat server on CentOS 6.5 requires an open service port for other computers to access Web apps deployed in Tomcat. Here's how to open a port.
There are two ways I know. The following is an example of an open 8080 port.
Method One: Command line mode
1. Open port command:/sbin/iptables-i input-p TCP--dport 8080-j ACCEPT
2. Save:/etc/rc.d/init.d/iptables Save
3. Restart Service:/etc/init.d/iptables restart
4. Check if the port is open:/sbin/iptables-l-N
Method Two: Directly edit the/etc/sysconfig/iptables file
1. Edit the/etc/sysconfig/iptables file: vi/etc/sysconfig/iptables
Add content and Save:-a rh-firewall-1-input-m State--state new-m tcp-p TCP--dport 8080-j ACCEPT
2. Restart Service:/etc/init.d/iptables restart
3. Check if the port is open:/sbin/iptables-l-N
Note: Need to pay attention to the specific protocol open port, I then open a port, the protocol was wrong, find a long time to find the reason.
Linux Open Service Port