This is the 10th day of my participation in the Challenge. For details, see:More article challenges

Recently, I bought a cloud server from the Internet, and installed Tomcat by myself, encountered Linux Tomcat installation access to less than 8080 problems, special record and share to everyone.

1, known

  • Known to enter ali Cloud
  • Enter the instance
  • The security group for port 8080 has been enabled

2, the current

In the browser, enter: Internet IP address :8080 For example, 39.108.13.29:8080

  • The Tomcat page is not displayed.
  • Run the ping command and enter the external IP address. For example, 39.108.13.29
  • Can ping
  • Log in to the xshell server
  • The curl http://39.108.13.29:8080/

You can see that there is no return information

3, check the

Input: ifconfg

ifconfg
Copy the code

4. Access the Intranet

  • The Intranet IP address of the server is found
  • Enter curl http://intranet IP address :8080 again
  • There’s something coming back

It proves that the Intranet is accessible and tomcat is normal. The problem may be the firewall of port 8080, because the security group has been opened.

5. View port 8080

Input: netstat – an | grep 8080 found 8080 port have been listening

netstat -an | grep 8080
Copy the code

Enter: firewall-cmd –query-port=8080/ TCP

firewall-cmd --query-port=8080/tcp
Copy the code
  • View the firewall status of port 8080

  • Enter: firewall-cmd –permanent –add-port=8080/ TCP
firewall-cmd --permanent --add-port=8080/tcp
Copy the code
  • Enable the firewall on port 8080

  • Check firewall-cmd –query-port=8080/ TCP again
firewall-cmd --query-port=8080/tcp
Copy the code
  • It’s still off

6. Restart the firewall

  • Input is firewall – CMD – reload
firewall-cmd --reload
Copy the code
  • Restarting the Firewall

  • After the restart, check again: firewall-cmd –query-port=8080/ TCP Firewall is enabled
firewall-cmd --query-port=8080/tcp
Copy the code

7. Access Tomcat again

  • Enter Internet IP address :8080 in the browser
  • The Tomcat page information is displayed
  • The installation is complete

The above problems have been dealt with. If there are any shortcomings, please find them for correction and improvement. Thanks for reading. Feel free to like and follow if it helps.