Tomcat download, installation and configuration detailed process

Brief description

 Tomcat 服务器是一个开源的轻量级Web应用服务器,在中小型系统和并发量小的场合下被普遍使用,是开发和调试Servlet、JSP 程序的首选。

1. Download and install

1. Official website download
Download address: Tomcat download address
Insert image description here
2. Select the version you need. Tomcat 9 used here.
Click Tomcat9 and select the appropriate version. Here, Windows is used as an example.
Insert image description here
3. Unzip the downloaded compressed package to the specified path.
Insert image description here

2. Configure environment variables

1. Right-click My Computer => Properties => System Advanced Settings => Environment Variables

Insert image description here
Insert image description here
Insert image description here
2. Add Tomcat configuration items
Add Tomcat configuration items in the system variables
a. Add a new system variable CATALINA_HOME, the variable value is the path of Tomcat
Insert image description here
Insert image description here
b. Put the variables added above into the Path system variable
%CATALINA_HOME%\bin
%CATALINA_HOME% \lib
Insert image description here

3. Verify installation configuration

1. Open the cmd window
win+r to open the run interface and enter "cmd" and press Enter
Insert image description here
2. Enter startup.bat
and another window will appear as shown below to indicate success.
Insert image description here

4. Configure Tomcat user permissions

Find the tomcat-users.xml file in the conf folder in the directory Insert image description here
and add users and permissions

<role rolename="tomcat"/> 
<role rolename="role1"/> 
<role rolename="manager-script"/> 
<role rolename="manager-gui"/>
<role rolename="manager-status"/> 
<role rolename="admin-gui"/> 
<role rolename="admin-script"/> 
<user username="tomcat" password="tomcat"
 roles="manager-gui,manager- script,tomcat,admin-gui,admin-script"/>

Insert image description here
Test:
Click these three buttons to enter the corresponding account and password to indicate success.
Insert image description here

Guess you like

Origin blog.csdn.net/A_awen/article/details/124411679
Recommended