2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
"About the Author":China's Cybersecurity Team for the Winter Olympics, CSDN Top 100, worked at Qi'anxin for many years, and wrote books based on practical work "Network Security Self-Study Course"It is suitable for students with weak foundation to systematically learn network security and master the most core technologies in the shortest time.
Download Tomcat official website https://tomcat.apache.org/download-10.cgi
Unzip the installation package to the specified directory. The unzipped directory should not contain Chinese characters.
bin
: Stores Tomcat commands. For example, startup is used to start Tomcat, and shutdown is used to shut it down..bat
The end is a Windows command,.sh
The end is the Linux commandconf
: Stores Tomcat configuration files.lib
: Stores the jar packages that Tomcat depends on at runtime.logs
: Operation log. Can be cleared.temp
: Temporary file. Can be cleared.webapps
: Store development projects. When tomcat starts, it will load the applications in the webapps directory.work
: Stores compiled files when Tomcat is running.The operation of Tomcat depends on the Java environment, otherwise an error will be reported.
The Which version on the official website shows the Java version that each Tomcat version depends on. For example, if we use 10.1.24, we need to install a Java environment of 11 or higher.
arrive https://www.oracle.com/java/technologies/downloads/
, select Windows version.
After the download is complete, double-click to install and click Next.
The new version of JDK will automatically configure the PATH environment variable. Open cmd and execute java -version
、javac -version
, the displayed version means the installation is successful.
At this time, running tomcat will still report an error, saying that you do not have a JAVA_HOME variable, then we will create a new JAVA_HOME variable, the variable value is the JDK installation directory, the path one level above bin.
Will%JAVA_HOME%bin
variable to the PATH environment variable.
Extension: If the environment variables cannot be saved after configuration, you can use the registry to modify the environment variables.
win + r
Open the Registry Editor and findHKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerEnvironment
. Add a string value of JAVA_HOME and add it to the leftmost of the Path data.%JAVA_HOME%bin;
After modifying the registry, restart the computer to make it effective.
1) Go to the bin directory of the Tomcat installation directory and double-click startup.dat.
Do not close the black window that pops up, enterhttp://127.0.0.1:8080/
, if you see this cat, it means Tomcat has started successfully. Close the black window and Tomcat will stop.
2) Go to the bin directory of Tomcat installation, enter cmd in the address bar, open cmd in the current path, enter startup to start Tomcat. You can stop Tomcat by entering shutdown or closing the black window.