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

Each time Docker starts a container, the IP and hosts specified operations

Preface Every time you use Docker to start a Hado...

What are the drawbacks of deploying the database in a Docker container?

Preface Docker has been very popular in the past ...

Detailed explanation of Vue mixin usage and option merging

Table of contents 1. Use in components 2. Option ...

A brief discussion on common operations of MySQL in cmd and python

Environment configuration 1: Install MySQL and ad...

Introduction and usage examples of ref and $refs in Vue

Preface In JavaScript, you need to use document.q...

Mysql experiment: using explain to analyze the trend of indexes

Overview Indexing is a skill that must be mastere...

Some useful meta setting methods (must read)

<meta name="viewport" content="...

Using loops in awk

Let's learn about different types of loops th...

MySQL database table partitioning considerations [recommended]

Table partitioning is different from database par...

How to install Composer in Linux

1. Download the installation script - composer-se...