Home >Operation and Maintenance >CentOS >What to do if CentOS tomcat cannot be accessed

What to do if CentOS tomcat cannot be accessed

angryTom
angryTomOriginal
2020-03-20 16:03:403255browse

What to do if CentOS tomcat cannot be accessed

What to do if CentOS tomcat cannot be accessed

Step 1. Start tomcat

Enter tomcat location Execute the "sh startup.sh" command in the bin folder of the directory to start tomcat. If the following situation occurs, tomcat starts successfully.

What to do if CentOS tomcat cannot be accessed

Step 2. Verify whether tomcat starts successfully

Enter the "ps -ef|grep tomcat" command to verify tomcat Whether the startup is successful? If the following situation occurs, it means the startup is successful.

What to do if CentOS tomcat cannot be accessedStep 3. Check whether the firewall is started

Enter the command "firewall-cmd --state". If this situation occurs as shown in the figure, it means that the firewall is running. Run, if it is not running, you need to execute the command "systemctl start firewalld" to start the firewall service

(recommended learning: Linux video tutorial)

What to do if CentOS tomcat cannot be accessed

Step 4. Check whether port 8080 is opened by the firewall

Enter the command " firewall-cmd --permanent --zone=public --list-ports " If the following appears: The situation in the picture shows that port 8080 is opened

What to do if CentOS tomcat cannot be accessed

#If the situation shown in the picture does not occur, you need to execute the command "firewall-cmd --zone=public --add- port=8080/tcp --permanent" opens port 8080. If "success" appears, it means the addition is successful.

Step 5. Restart the firewall

Enter the command "firewall-cmd --reload" to restart the firewall. If the word "success" appears, it means the restart is successful.

What to do if CentOS tomcat cannot be accessed

Step 6. Verify whether the opened 8080 port is effective

Enter the command "firewall-cmd --zone=public -- query-port=8080/tcp" Verify whether the 8080 port is valid. If the word "yes" appears, it means it is valid.

What to do if CentOS tomcat cannot be accessed

#At this point you can use an external browser to access tomcat in centos.

This article comes from the PHP Chinese website, CentOS usage tutorial column, please pay attention to this column for more related tutorials!

The above is the detailed content of What to do if CentOS tomcat cannot be accessed. 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