下载tomcat linux的包,地址:http://tomcat.apache.org/download-80.cgi,我们下载的版本是8.0,下载方式如下
查看服务器是否已经安装依赖jdk:java -version(如果没有可以查看centos安装jdk)
[root@iZ44qcuj3sp989Z ~]# java -version
java version "1.7.0_171"
OpenJDK Runtime Environment (rhel-2.6.13.0.el7_4-x86_64 u171-b01)
OpenJDK 64-Bit Server VM (build 24.171-b01, mixed mode)
在Xshell中使用命令跳转到local下面创建者自己的文件夹:tomcat8.5.28/
[root@iZ44qcuj3sp989Z /]# ls
bin dev home lib64 media opt root sbin sys usr yjdata
boot etc lib lost+found mnt proc run srv tmp var
[root@iZ44qcuj3sp989Z /]# cd usr/
[root@iZ44qcuj3sp989Z usr]# cd local/
[root@iZ44qcuj3sp989Z local]# ls
aegis bin etc include lib64 php5.5 share
apache2 curl games lib libexec sbin src
[root@iZ44qcuj3sp989Z local]# mkdir tomcat8.5.28
[root@iZ44qcuj3sp989Z local]# cd tomcat8.5.28/
[root@iZ44qcuj3sp989Z tomcat8.5.28]# ls
上传下载好的tomcat压缩包到文件夹中,rz命令上传选择文件
[root@iZ44qcuj3sp989Z tomcat8.5.28]# rz
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring apache-tomcat-8.5.28.tar...
100% 13770 KB 292 KB/sec 00:00:47 0 Errors
解压缩apache-tomcat-8.5.28.tar
tar -xvf apache-tomcat-8.5.28.tar
启动tomcat
[root@iZ44qcuj3sp989Z bin]# /usr/local/tomcat8.5.28/apache-tomcat-8.5.28/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat8.5.28/apache-tomcat-8.5.28
Using CATALINA_HOME: /usr/local/tomcat8.5.28/apache-tomcat-8.5.28
Using CATALINA_TMPDIR: /usr/local/tomcat8.5.28/apache-tomcat-8.5.28/temp
Using JRE_HOME: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75.x86_64/jre
Using CLASSPATH: /usr/local/tomcat8.5.28/apache-tomcat-8.5.28/bin/bootstrap.jar:/usr/local/tomcat8.5.28/apache-tomcat-8.5.28/bin/tomcat-juli.jar
Tomcat started.