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

MySQL changes the default engine and character set details

Table of contents 1. Database Engine 1.1 View dat...

Implementation of Jenkins+Docker continuous integration

Table of contents 1. Introduction to Jenkins 2. I...

ReactJs Basics Tutorial - Essential Edition

Table of contents 1. Introduction to ReactJS 2. U...

Install Linux using VMware virtual machine (CentOS7 image)

1. VMware download and install Link: https://www....

Writing daily automatic backup of MySQL database using mysqldump in Centos7

1. Requirements: Database backup is particularly ...

How to solve the problem of ERROR 2003 (HY000) when starting mysql

1. Problem Description When starting MYSQL, a pro...

Analysis of JavaScript's event loop mechanism

Table of contents Preface: 1. Reasons for the eve...

Example of implementing colored progress bar animation using CSS3

Brief Tutorial This is a CSS3 color progress bar ...

Detailed explanation of Nginx configuration file

The main configuration file of Nginx is nginx.con...

How to create a table in mysql and add field comments

Directly post code and examples #Write comments w...

How to deploy springcloud project with Docker

Table of contents Docker image download Start mys...

In-depth study of MySQL composite index

A composite index (also called a joint index) is ...

Detailed analysis of each stage of nginx's http request processing

When writing the HTTP module of nginx, it is nece...

mysql installer community 8.0.12.0 installation graphic tutorial

This tutorial shares the installation of mysql in...

WeChat applet picker multi-column selector (mode = multiSelector)

Table of contents 1. Effect diagram (multiple col...