Linux tomcat安装

一、 下载

官网去下载压缩包: https://tomcat.apache.org/download-80.cgi
在这里插入图片描述

二、 上传

将压缩包上传至服务器,然后解压,这里我上传的地方是opt下面

解压命令:

tar zxvf apache-tomcat-8.5.40.tar.gz 

在这里插入图片描述

三、 环境变量

vim /etc/profile.d/tomcat.sh
# tomcat存放的位置
CATALINA_BASE=/opt/apache-tomcat-8.5.40
PATH=$CATALINA_BASE/bin:$PATH
export PATH CATALINA_BASE

让配置生效:

source  /etc/profile.d/tomcat.sh

四、 检查

查看tomcat版本状态:

catalina.sh version

在这里插入图片描述
至此,安装成功!

五、一些命令

############### 进入 tomcat bin目录#######
cd /opt/apache-tomcat-8.5.40/bin/
############## 启动(两种方式)#######
## 方式一(推荐)
catalina.sh start
## 方式二
# ./startup.sh
########### 停止 (两种方式)#########
## 方式一(推荐)
catalina.sh stop
## 方式二
# ./shutdown.sh
posted @ 2019-05-29 17:14  leigq  阅读(66)  评论(0编辑  收藏  举报