Table of contents
friendly reminder
First look at the article directory to get a general understanding of the structure of the knowledge points. You can directly click on the article directory to jump to the specified location of the article.
Chapter 1, Tomcat download and installation
1.1) Introduction to Tomcat
①Tomcat is a core project of Apache, jointly developed by Apache, Sun and some other companies and individuals.
②Tomcat server is a free and open source web lightweight application server, which is the first choice for developing and debugging JSP programs.
③Tomcat actually runs JSP pages and Servlets. Like Web servers such as IIS, Tomcat has the function of processing HTML pages. In addition, it is also a Servlet and JSP container. The independent Servlet container is the default mode of Tomcat.
1.2) Official website download
Tomcat official website download address: Official website download address
①Enter the official website: Select Tomcat9
②Select Windows version 64-bit
③Decompress and use directly after downloading, pay attention to the decompression path is best not in the C
drive
Chapter 2, Tomcat configuration environment variables
2.1) Windows environment variable configuration
①Win+E to open the manager –> This computer –> Properties
②Choose advanced system settings ③Choose
environment variables ④Create
new system variables ⑤Enter the variable name and the file path
downloaded and installed before, click OK %CATALINA_HOME%\bin
2.2) Verify that the Tomcat configuration is successful
Win+R, enter cmd and press Enter, and then enter startup.bat in the DOS window and press Enter.
The following interface appears to indicate success
2.3) Error resolution
①If an error occurs or it passes by in a flash, it may be that the default port number 8080 is occupied.
You can modify the port number in server.xml
② Modify the access port
Use Notepad or WordPad to open the file, find "Connector port=8080" in the file, change "8080" to the desired port number, save it, and restart the Tomcat server
Chapter 3, IDEA integrates Tomcat
3.1) Open the IDEA development tool
①Add Configuration—>click the plus sign—>find Tomcat server—>click local
②Select the Tomcat file location
③Put the project into a war package: select Department—>click the plus sign—>select Artifact—>Apply—>ok
3.2) Run Tomcat
④Click the green triangle to run, Tomcat can be used in IDEA