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

WBOY
Release: 2022-04-20 17:03:04
Original
4165 people have browsed it

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
Copy after login

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
Copy after login

Open the firewall

2. Check whether port 8080 is open:

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

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
Copy after login

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
Copy after login

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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!