报错异常:

9.0.41tomcat启动后无法访问web页面 - 图1

总结来说:关防火墙,改文件夹名,刷新浏览器

  1. [root@test 12345]# service firewalld status //查看防火墙状态
  2. Redirecting to /bin/systemctl status firewalld.service
  3. firewalld.service - firewalld - dynamic firewall daemon
  4. Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
  5. Active: active (running) since Thu 2021-01-14 20:55:23 PST; 19h ago
  6. Docs: man:firewalld(1)
  7. Main PID: 673 (firewalld)
  8. Tasks: 2
  9. Memory: 1.0M
  10. CGroup: /system.slice/firewalld.service
  11. └─673 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
  12. Jan 14 20:55:32 test firewalld[673]: WARNING: COMMAND_FAILED: '/usr/sbin/ip...e.
  13. ...
  14. ...
  15. Jan 14 20:55:33 test firewalld[673]: WARNING: COMMAND_FAILED: '/usr/sbin/ip...).
  16. Hint: Some lines were ellipsized, use -l to show in full.
  17. [root@test 12345]# service firewalld stop //关闭防火墙
  18. Redirecting to /bin/systemctl stop firewalld.service
  19. root@test 12345]# docker ps //再查看运行中的容器
  20. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  21. 79f229042aae tomcat "catalina.sh run" 49 seconds ago Up 47 seconds 0.0.0.0:8888->8080/tcp cranky_wu
  22. [root@test 12345]# docker exec -it 79f229042aae /bin/bash //进入容器内部
  23. root@79f229042aae:/usr/local/tomcat# ls
  24. BUILDING.txt CONTRIBUTING.md LICENSE NOTICE README.md RELEASE-NOTES RUNNING.txt bin conf lib logs native-jni-lib temp webapps webapps.dist work
  25. root@79f229042aae:/usr/local/tomcat# cd webapps
  26. root@79f229042aae:/usr/local/tomcat/webapps# ls
  27. root@79f229042aae:/usr/local/tomcat/webapps# cd ..
  28. root@79f229042aae:/usr/local/tomcat# ls
  29. BUILDING.txt CONTRIBUTING.md LICENSE NOTICE README.md RELEASE-NOTES RUNNING.txt bin conf lib logs native-jni-lib temp webapps webapps.dist work
  30. root@79f229042aae:/usr/local/tomcat# mv webapps webapps2 //将两个文件夹分别改名
  31. root@79f229042aae:/usr/local/tomcat# mv webapps.dist webapps //将两个文件夹分别改名
  32. root@79f229042aae:/usr/local/tomcat#

刷新浏览器重新访问就好
image.png