Home > Operation and Maintenance > CentOS > What should I do if I cannot access Tomcat after opening it on CentOS?

What should I do if I cannot access Tomcat after opening it on CentOS?

coldplay.xixi
Release: 2020-07-28 15:51:38
Original
3488 people have browsed it

The solution to the problem that CentOS cannot access Tomcat after opening it: first open the firewall, the code is [systemctl start firewalld]; then execute the command to open the 8080 port, and then restart the firewall; finally verify that the opened 8080 port takes effect. Can.

What should I do if I cannot access Tomcat after opening it on CentOS?

Solution to the inability to access CentOS after opening Tomcat:

First check whether the firewall is started:

firewall-cmd --state
Copy after login

If "running" appears, the firewall is running. If there is no prompt, enter the command to open the firewall:

systemctl start firewalld
Copy after login

Then enter the command to check whether port 8080 is opened by the firewall (if "8080/tcp" appears "Indicates that the port is opened):

firewall-cmd --permanent --zone=public --list-ports
Copy after login

If nothing is prompted, it means that port 8080 is not opened; you need to execute the command to open port 8080 (if "success" appears, it means the addition was successful):

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

Restart the firewall:

firewall-cmd --reload
Copy after login

Finally, verify whether the opened 8080 port is effective (you can also directly access tomcat through the browser to test):

firewall-cmd --zone=public --query-port=8080/tcp
Copy after login

If "yes" appears , indicating that the opening is successful, so that you can access tomcat normally!

Recommended related tutorials: centos tutorial

The above is the detailed content of What should I do if I cannot access Tomcat after opening it on CentOS?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template