The following column centos basic tutorial will introduce to you how to deploy tomcat in centos and solve the remote access ban. I hope it will be helpful to friends in need!
1. Use the scp command to upload the tomcat compressed package downloaded from the website to the server, and then decompress it to the /usr/local directory. About scp is used as follows:
scp ./filename username@IP:/home/bio321/Desktop
scp username@IP:/home/bio321/Desktop/filename ./data
2. After deployment, access the tomcat connection and access localhost:8080 locally. Successfully, the remote ping 172.28.162.62:8080 prompts that the host cannot be found and remote access is denied. The solution is as follows:
1. View tomcat process information: ps -ef |grep tomcat
2. View the port number occupied by the process number: netstat -apn | grep 9119
It is found that there is no problem with the port number, so the problem should be checked elsewhere;
3. Check whether the Linux firewall opens the tomcat port:
If it is not set, the Tomcat port number is disabled by default, because Linux ports will only open port 22 by default
You need to set up a firewall and open port access permissions (it is not recommended to turn off the firewall directly)
Set open port command: firewall-cmd --zone=public --add-port=8080/tcp permanent
4. Restart the firewallfirewall-cmd --reload
The above is the detailed content of About deploying tomcat on centos and solving remote access ban. For more information, please follow other related articles on the PHP Chinese website!