This article is written based on the pits I have stepped on.
If it solves your problem, please like, bookmark and comment.
Download of Tomcat8.5
下载的地址:https://tomcat.apache.org/download-80.cgi
Install
In fact, the program at this time has been installed, but the Tomcat8.5 server has not been installed (will be described below), it is the format of such a folder. Unlike QQ there is a .exe
file to install. We will move this folder to the location you want.
Configuration Environment
The path of the above environment configuration is configured according to your own specific path.
Server installation
用管理员身份打开cmd,进入安装tomcat的bin目录下输入service.bat install
The above picture shows that the installation is successful.
run the test
Method 1: under the bin folder and
then input in the browser: http://localhost:8080/
the above picture is the interface after success.
Problem: The start is closed halfway through, and it has not been opened.
solution: 删除Tomcat服务器再次安装, bin目录下打开cmd
service.bat remove 移除tomcat服务
service.bat install 再次安装服务
If the above method does not work, then try the second solution.
Method 2: Find the shutdown.bat file and shutdown.bat in the bin folder
shutdown.bat点击运行,作用是,关闭计算机上可能已开启的Tomcat相关服务,以防占去8080端口
shutdup.bat点击运行,作用是,开启Tomcat服务
So we first shut down the service, and then start the service. click firstshutdown.bat再shutdup.bat
See what happens at this point http://localhost:8080/
, if not.
Just inside the shutdown.bat
and shutdup.bat
file both add:
SET JAVA_HOME=D:\IntelliJ IDEA Community Edition 2021.3.3\jbr
SET TOMCAT_HOME=D:\apache-tomcat-8.5.77-windows-x64\apache-tomcat-8.5.77
Note: First make it into a txt file, add it and save it, and then change it back to bat, otherwise it will pass by in a flash or it will not be changed.
Pay special attention to the fact that the things added above are configured according to the actual path of your own file, do not copy directly, because the location of each person's file may be different.
The first one added above is the path to the JDK environment, because our Tomcat needs the JAVA environment.
The second is the path to the Tomcat folder.
After the above is done, click shutdup.bat
at this time and it is done, and the website can be accessed. The reason for the garbled characters is that the encoding is different, so don't worry about this.