404 error occurs when accessing the homepage of tomcat started in Docker mode

404 error occurs when accessing the homepage of tomcat started in Docker mode

Scenario:

When starting tomcat in docker (version 8.5.50 downloaded from Alibaba Cloud), a 404 error occurred when accessing the tomcat homepage. I searched for many tutorials online but could not find a solution. Finally, I found the problem in the video explanation (I don't know if it was the problem with the version I downloaded)

Specific situation:

Use the command: docker exec -it to run the tomcat container ID /bin/bash to enter the tomcat directory

Enter the webapps folder and find that it is empty (the default welcome page of tomcat should actually be placed in the path: webapps/ROOT/index.jsp or index.html)

I found that there was a webapps.dist file next to it. When I entered it, I found that all the files that should have been in the webapps file were in the webapps.dist file. Now I don’t know why! ! !

picture:

Rename webapps.dist to webapps. The original webapps (empty file) can be deleted or renamed to another name: mv webapps.dist webapps

Note: If it is on the server, remember to open the mapped host port, otherwise it will not be accessible.

This is the end of this article about the 404 error when accessing the homepage when starting tomcat with Docker. For more related content about 404 error when starting tomcat with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to install tomcat8 in docker
  • How to install tomcat in docker and deploy the Springboot project war package
  • Steps to deploy multiple tomcat services using DockerFile on Docker container
  • Docker Nginx container and Tomcat container to achieve load balancing and dynamic and static separation operations
  • Detailed steps for installing Tomcat, MySQL and Redis with Docker
  • Why can't I see the access interface for Docker Tomcat?
  • How to set the memory size of Docker tomcat

<<:  XHTML Tutorial: XHTML Basics for Beginners

>>:  Detailed Example of MySQL InnoDB Locking Mechanism

Recommend

Table setting background image cannot be 100% displayed solution

The following situations were discovered during d...

Four completely different experiences in Apple Watch interaction design revealed

Today is still a case of Watch app design. I love...

Mobile terminal adaptation makes px automatically converted to rem

Install postcss-pxtorem first: npm install postcs...

How to install MySQL 5.7.29 with one click using shell script

This article refers to the work of 51CTO blog aut...

Implementation steps for installing Redis container in Docker

Table of contents Install Redis on Docker 1. Find...

Two methods of restoring MySQL data

1. Introduction Some time ago, there were a serie...

CSS3 transition to implement notification message carousel

Vue version, copy it to the file and use it <t...

Example of how to use CSS3 to layout elements around a center point

This article introduces an example of how CSS3 ca...

Teach you how to implement the observer mode in Javascript

Table of contents What is the Observer Pattern? S...

Nginx rtmp module compilation arm version problem

Table of contents 1. Preparation: 2. Source code ...

Vuex modularization and namespaced example demonstration

1. Purpose: Make the code easier to maintain and ...