Home>Article>Operation and Maintenance> How to solve the problem of being unable to access centos after installing tomcat
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.
The operating environment of this article: centos 7 system, Dell G3 computer.
Enter the decompressed bin directory to start tomcat, enter the following command to start tomcat: ./startup.sh
The following interface appears. Started successfully
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
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
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
After successfully opening it, check the open port list and you will see 8080
4. Restart the firewall :
firewall-cmd --reload
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!