Tomcat download, install, configure environment variables and verify

Tomcat download

First install the JDK and configure the environment variables of the JDK (I won't go into details here)

Enter the official website to download Tomcat

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

Choose the version you want to install

Click on the icon below

 Select the download version (I installed Tomcat8 here)

Tomcat installation 

After the download is complete, decompress the compressed package and put it on the D drive ( try not to put it on the C drive )

Tomcat configuration environment variables

right click computer properties

 Click on Advanced System Settings

 In the first step, click Advanced, and in the second step, click Environment Variables

 

 Create a new variable in the system variable

 Then enter the variable name and variable value

Variable name: CATALINA_HOME

The variable value is: Tomcat decompressed path (click the red box and then ctrl+c to copy)

My variable value is: D:\apache-tomcat-8.5.71 

After entering the variable name and variable value, click OK

 Then find the variable named Path in the system variables, select it and click Edit, then click Edit Text , select OK , and finally click OK

 

Add %CATALINA_HOME%\bin;  after the variable value (note the " ; " at the end and don't miss it)

Also, if %CATALINA_HOME%\bin; there is no " ; " in front of % , remember to add it (note that it is " " in English  )

After that, click OK to configure

Tomcat authentication

Enter cmd to open a command prompt

Enter startup.bat in the command prompt

 If the Tomcat startup window appears, the startup is successful, keep cmd running ( cannot be closed )

If there are errors, flashes, etc., it may be that your port is occupied. The default port of Tomcat is 8080. If these two situations occur, you can try the following two:

1. Restart the computer and try again

2. Start Tomcat again after modifying the Tomcat port number

(1) Open the tomcat installation directory, open the conf folder, right-click to edit the server.xml file, find the following code, and modify 8080 to a port between 1025-65535

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Verify that the environment variable is configured successfully

Enter  http://localhost:8080 in the browser

Key point: cmd cannot be closed, and Tomcat is also closed when it is closed!

This picture shows that the configuration is successful

If you don’t understand, you can communicate with each other (~ ̄▽ ̄)~

Guess you like

Origin blog.csdn.net/m0_62298221/article/details/120485811