Open access to tomcat port number under Linux

1. Specific settings
1. Test whether the port can be accessed

After the installation is successful, open the browser on the machine and enter http: // current linux ip: 8080 or 80 Enter to access, if you can open the tomcat page, you do not need to configure the firewall, otherwise you need to open the firewall 8080 or 80 configuration ;

2. Configuration method

Note: The following commands are only for CentOs 7 and above. After CentOS is upgraded to 7, you cannot use iptables to control the port of Linuxs. The reason is that Centos 7 uses firewalld instead of the original iptables;

2.1. Enter the command:

firewall-cmd --zone=public --add-port=8080/tcp --permanent

or

firewall-cmd --zone=public --add-port=80/tcp --permanent

Configure the 8080 port open configuration:

Command parsing:

--zone #Scope

--add-port = 8080 / tcp #Add port, the format is: port / communication protocol

--permanent #Permanently effective, without this parameter setting, it will be invalid after restart.

2.2 Restart the firewall

Command: firewall-cmd --reload

Then you continue to visit http: // current linux ip: 8080 or 80.

Guess you like

Origin www.cnblogs.com/yuezc/p/12699665.html