Home>Article>Operation and Maintenance> About deploying tomcat on centos and solving remote access ban

About deploying tomcat on centos and solving remote access ban

藏色散人
藏色散人 forward
2020-12-02 15:14:53 2264browse

The following columncentos basic tutorialwill 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!

About deploying tomcat on centos and solving remote access ban

Deploy tomcat

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:

  • Transfer client data to the server

scp ./filename username@IP:/home/bio321/Desktop

  • The server-side data is transferred to the client

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 firewall
firewall-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!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete