Brief description
Tomcat 服务器是一个开源的轻量级Web应用服务器,在中小型系统和并发量小的场合下被普遍使用,是开发和调试Servlet、JSP 程序的首选。
1. Download and install
1. Official website download
Download address: Tomcat download address
2. Select the version you need. Tomcat 9 used here.
Click Tomcat9 and select the appropriate version. Here, Windows is used as an example.
3. Unzip the downloaded compressed package to the specified path.
2. Configure environment variables
1. Right-click My Computer => Properties => System Advanced Settings => Environment Variables
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
b. Put the variables added above into the Path system variable
%CATALINA_HOME%\bin
%CATALINA_HOME% \lib
3. Verify installation configuration
1. Open the cmd window
win+r to open the run interface and enter "cmd" and press Enter
2. Enter startup.bat
and another window will appear as shown below to indicate success.
4. Configure Tomcat user permissions
Find the tomcat-users.xml file in the conf folder in the directory
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"/>
Test:
Click these three buttons to enter the corresponding account and password to indicate success.