Tomcat installation and configuration tutorial (super detailed!)

table of Contents

1. Official website download

Two, configure environment variables

Three, install Tomcat9 service items

Fourth, start the Tomcat9 service


1. Official website download

Official website link: http://tomcat.apache.org/

1. Select tomact9 under Download on the left (the editor downloaded tomact9) as shown in the figure below:

2. Pull down the content and select the format to download, (the editor chooses the 64-bit green version) as shown in the figure below:

3. After the download is complete, unzip it and unzip it to a custom location!

Two, configure environment variables

1. In the'System Variables', create a new TOMCAT_HOME, if it already exists, click Edit. As shown in the figure below:

The variable value is the decompressed path, and you can find it by browsing the record query:

2. In the'System Variables', create a new CATALINA_HOME, if it already exists, click Edit. As shown in the figure below:

The variable value is the decompressed path, and you can find it by browsing the record query:

 

 

3. Add %CATALINA_HOME%\bin in the PATH, as shown in the following figure:

4. Add %CATALINA_HOME%\lib\servlet-api.jar in CLASSPath (Note: there is no semicolon after it), as shown in the figure below:

Note: If you cannot find the CLASSPath variable in the system variables, you can manually add one:

Three, install Tomcat9 service items

 Click "Start"-"Run", enter "cmd", and enter service install Tomcat9 in the console.

Install Tomcat9 service items in the system

 

Fourth, start the Tomcat9 service

Click Start, search for services or enter Control Panel—System and Security—Administrative Tools—Services, find the Apache Tomcat Tomcat9 service item, right-click the item, and click "Start" to start the service

After startup

Finally open the browser, enter http://localhost:8080 or http://127.0.0.1:8080 in the address bar

If the tomcat sample homepage appears, it means that the server is installed successfully

 

 

Question: If port 8080 is occupied, you can modify the tomcat access port.
Find the server.xml in the D:\Tomcat\apache-tomcat-9.0.20-windows-x64\apache-tomcat-9.0.20\conf directory to
open it File, find the following content
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Change the port="8080" to port="9090" (or other ports are fine) as shown in the figure below:

Guess you like

Origin blog.csdn.net/TGB_Tom/article/details/110671074