Home>Article>Operation and Maintenance> How to solve the problem of being unable to access centos after installing tomcat

How to solve the problem of being unable to access centos after installing tomcat

WBOY
WBOY Original
2022-04-20 17:03:04 4115browse

Solution: 1. Use "systemctl start firewalld" to open the firewall; 2. Check whether port 8080 is open. If not, open port 8080; 3. Use "firewall-cmd --reload" to restart the firewall. After that, you can access successfully again.

How to solve the problem of being unable to access centos after installing tomcat

The operating environment of this article: centos 7 system, Dell G3 computer.

How to solve the problem that centos cannot access after installing tomcat

Enter the decompressed bin directory to start tomcat, enter the following command to start tomcat: ./startup.sh

The following interface appears. Started successfully

How to solve the problem of being unable to access centos after installing tomcat

Then open the browser to access port 8080 and find that it cannot be accessed

Solution:

1. Check whether the firewall is turned on:

firewall-cmd --state

The scene shown below indicates that the firewall is turned on

How to solve the problem of being unable to access centos after installing tomcat

If it is not turned on, you need to enter:

systemctl start firewalld

Open the firewall

2. Check whether port 8080 is open:

firewall-cmd --permanent --zone=public --list-ports

If no port is displayed after entering the command, it means it is not open now. port, you need to open port 8080

How to solve the problem of being unable to access centos after installing tomcat

3. Open port 8080. If you need to open other ports, just change the port number

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

How to solve the problem of being unable to access centos after installing tomcat

After successfully opening it, check the open port list and you will see 8080

How to solve the problem of being unable to access centos after installing tomcat

4. Restart the firewall :

firewall-cmd --reload

How to solve the problem of being unable to access centos after installing tomcat

5. Access port 8080 and successfully access

Recommended tutorial: "centos tutorial"

The above is the detailed content of How to solve the problem of being unable to access centos after installing tomcat. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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