Apache Tomcat Installation and Configuration Tutorial

JDK installation and configuration

1. From the official website to download JDK

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2. After the download is complete, install the JDK (directly follow the installation wizard prompts to install).

You can choose to install their own installation path, my installation path is D: \ JDK

 3. Set Environment Variables

 3.1 'system variables', create the JAVA_HOME, If there is already the click Edit. Variable value installation path.

Add 3.2% JAVA_HOME% \ bin in the PATH;

3.3 'system variables', create the CLASSPATH, If there is already the click Edit.

Variable value;.% JAVA_HOME% \ lib \ dt.jar;% JAVA_HOME% \ lib \ tools.jar;

Note: To add represents the current path, and a semicolon in front of a little number, but also behind the end of a semicolon.

 4. environment variable configuration, JDK to test whether the configuration.

 Click "Start" - "Run" and type "cmd", and then enter the command respectively java -version, java, javac, if similar to the following screen appears to indicate that the installation was successful:

 Enter java -version

 

 Enter java

Enter javac

 

Tomcat installation and configuration

 1. go to the official website to download

http://tomcat.apache.org/

I downloaded tomcat9:

https://tomcat.apache.org/download-90.cgi

 FIG under the red box, two of the above Soft (need to configure the environment variables), following a version of the installation.

 

I am here to download the green version, unzip the download is complete, unzip to D: \ Tomcat \ apache-tomcat-9.0.20-windows-x64

2. Configure Environment Variables

2.1 'system variables', the new TOMCAT_HOME, Ruoyi exist, click Edit.

Extracting the value of the variable path

 

2.2 在'系统变量'中, 新建CATALINA_HOME, 若已存在则点击编辑.

变量值为 解压的路径

 

2.3 在PATH中添加 %CATALINA_HOME%\bin

2.4 在CLASSPath中添加 %CATALINA_HOME%\lib\servlet-api.jar (后面没有分号)

 

3. 单击“开始”—“运行”,输入"cmd",在控制台输入 service install Tomcat9.

在系统中安装Tomcat9服务项

 

4. 点击开始, 搜索 服务 或者 进入控制面板—系统和安全—管理工具—服务,找到Apache Tomcat Tomcat9服务项,右击该项,点“启动”,启动该服务

启动后

 

5. 打开浏览器, 地址栏输入http://localhost:8080 或 http://127.0.0.1:8080

如果出现tomcat示例主页,则表示服务器安装成功

 

如果8080端口被占用了,可以修改tomcat的访问端口
找到 D:\Tomcat\apache-tomcat-9.0.20-windows-x64\apache-tomcat-9.0.20\conf 目录下的 server.xml
打开该文件, 找到以下内容
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

将其中的 port="8080" 改为 port="9090"(或者其他端口即可)

 

Guess you like

Origin www.cnblogs.com/BlameKidd/p/10929507.html
Recommended