Tomcat installation configuration

Time:2022-11-24

Tomcat download

Tomcat download address

​ Generally do not download the new version, it is better to download a more stable version, I download Tomcat 9 here

Tomcat installation configuration

Click tomcat 9 under download on the left to enter the download page

Tomcat installation configuration

  • MirrosYou can change the mirror source, if it is too slow, you can change it, but the file itself is not big, just over 10M
  • CoreJust select the corresponding version in 64, select 64bit-Windows zip for windows, and tar for linux version
  • Source CodeThere are also source files below

in addition,downloadBelow there arearchive(documentation), there are directories of each version, enter the bin directory to download

Tomcat installation configuration

Tomcat installation configuration

Then download and unzip to the specified directory

Tomcat configuration

tomcat is written in java and needs jvm to run, so it needs to configure JDK. If the following environment is not configured, it will crash

Create a new system variable JAVA_HOME ——–> your jdk installation directory (eg: D:\DevEvironment\openjdk-11.0.2)

Click on path and create a new input: %JAVA_HOME%/bin

Turn on:Then enter the bin directory under the tomcat 9 decompression directory, clickstartup.batBatch file, when the startup time appears, tomcat can be started

Tomcat installation configuration

Enter the browser and enter:http://localhost:8080orhttp://127.0.0.1:8080 to open…

Tomcat installation configuration

closure:Just click the console to close it, or enter the bin directory, clickshutdown.dat

In addition, the console is garbled

Click the console title bar and properties, you can see that it is GBK encoding, and the tomcat console is UTF-8 encoding, so there will be garbled characters

Tomcat installation configuration

You can choose to go to the registry to change the encoding of the console, or you can change the encoding of tomcat

This I use to change the tomcat encoding:

Entertomcat installation directory/conf/logging.properties, open with notepad,ctrl + fsearchjava.util.logging.ConsoleHandler.encoding = UTF-8, just change to GBK encoding, and then restart tomcat

Introduction to the Tomcat Directory

  • bin mainly stores binary executable files and scripts.
  • conf mainly stores various configuration files.
  • lib is mainly used to store the jar packages that Tomcat needs to load when running.
  • logs Mainly store the log files generated by Tomcat during operation.
  • temp mainly stores temporary files generated by Tomcat during operation.
  • webapps mainly stores applications, and when Tomcat starts, it will load the applications in this directory.
  • work mainly stores the compiled files of tomcat at runtime, such as JSP compiled files.

——-Follow-up update—–