Linux下安装tomcat9

Linux下安装tomcat9

一、下载tomcat9

1.1 官网下载

??Tomcat官网下载对应版本的tar.gz文件,然后上传到linux服务器。

1.2 wget下载

??地址可能不能使用,需要重新找。

wget  http://mirrors.cnnic.cn/apache/tomcat/tomcat-9/v9.0.0.M9/bin/apache-tomcat-9.0.0.M9.tar.gz

二、解压

  1. 用tar命令解压后,会生成apache-tomcat-9.0.0.M9目录;
  2. 把apache-tomcat-9.0.0.M9移动到/usr/local目录下
tar -zxvf apache-tomcat-9.0.27.tar.gz
mv apache-tomcat-9.0.27 /usr/local

三、Tomcat服务相关

1、进入解压目录的bin文件夹,运行命令./startup.sh

./startup.sh

会自动输出下面内容:

Using CATALINA_BASE:   /usr/local/apache-tomcat-9.0.27
Using CATALINA_HOME:   /usr/local/apache-tomcat-9.0.27
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.27/temp
Using JRE_HOME:        /usr/local/jdk1.8/jre
Using CLASSPATH:       /usr/local/apache-tomcat-9.0.27/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.27/bin/tomcat-juli.jar

2、验证是否成功开启
??在浏览器输入http://127.0.0.1:8080 ,或者使用命令w3m http://127.0.0.1:8080(w3m命令没有的话,请使用apt-get或者yum安装,具体请百度)

w3m http://127.0.0.1:8080

3、关闭服务
??进入解压目录的bin文件夹,运行命令./shutdowm.sh

./shutdowm.sh

会自动输出下面内容:

Using CATALINA_BASE:   /usr/local/apache-tomcat-9.0.27
Using CATALINA_HOME:   /usr/local/apache-tomcat-9.0.27
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.27/temp
Using JRE_HOME:        /usr/local/jdk1.8/jre
Using CLASSPATH:       /usr/local/apache-tomcat-9.0.27/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.27/bin/tomcat-juli.jar

4、查看tomcat版本
??进入解压目录的bin文件夹,运行命令./version.sh

./version.sh

会自动输出下面内容:

Using CATALINA_BASE:   /usr/local/apache-tomcat-9.0.27
Using CATALINA_HOME:   /usr/local/apache-tomcat-9.0.27
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.27/temp
Using JRE_HOME:        /usr/local/jdk1.8/jre
Using CLASSPATH:       /usr/local/apache-tomcat-9.0.27/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.27/bin/tomcat-juli.jar
Server version: Apache Tomcat/9.0.27
Server built:   Oct 7 2019 09:57:22 UTC
Server number:  9.0.27.0
OS Name:        Linux
OS Version:     3.10.0-957.21.3.el7.x86_64
Architecture:   amd64
JVM Version:    1.8.0_131-b11
JVM Vendor:     Oracle Corporation

Linux下安装tomcat9

上一篇:linux 环境JDK 环境变量配置


下一篇:HyperLedger Fabric超级账本简介(5.2)