idea to run tomcat can not access the home page 8080 issue

problem

Initial use IntelliJ IDEA, but today after running Tomcat project started, found it impossible to access the Tomcat home page, 404 error: Enter http: // localhost: 8080 can not access the Tomcat home page, but you can access other pages right project.

 

the reason

The reason for this problem is: the work output directory of our project in our specified directory, rather than in the webapps directory of tomcat installation of the Apache-tomcat.

IDEA in the "Project directory \ out \ artifacts" a virtual Tomcat, and in the Tomcat home directory and no project. But this time did not deploy Tomcat home project to the server, so it is not Tomcat home visit, and the visit to our project in the other pages of information. 

Solution

The solution is to deploy Tomcat home page of the project to the Tomcat server, deployment steps are as follows:

Select the menu bar "Run -> Edit Configuration ...--> Deployment", select the top right corner of the green "+", select "External Source ...", the ROOT directory file in the Apache-tomcat webapps folder selected, click OK, and complete the deployment of Tomcat home page of the project. After selecting the file to the right ROOT Application Context not fill, default.

 

 Select the menu bar "Run -> Edit Configuration ...--> Deployment", select the top right corner of the green "+", select "Artifact ...", select exploded item, click OK.

  

 Application Context can fill out the right side of the name of the access URL.

Run the project again, the project successfully run it.

This then visit http: // localhost: 8080 /, familiar cat out.

 

Reproduced in:  https://www.cnblogs.com/yayazi/p/7920257.html   the brother

Guess you like

Origin www.cnblogs.com/hhz-97/p/12183054.html