//搭建环境
Tomcat默认端口为8080,必要时可自行更改
linux机IP为192.168.200.120
[root@localhost ~]# rz -E
z waiting to receive.**B0100000023be50
[root@localhost ~]# ls
anaconda-ks.cfg jdk-8u191-linux-x64.tar.gz original-ks.cfg 模板 图片 下载 桌面
initial-setup-ks.cfg nginx-1.15.9.tar.gz 公共 视频 文档 音乐
[root@localhost ~]# tar xf jdk-8u191-linux-x64.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg jdk1.8.0_191 nginx-1.15.9.tar.gz 公共 视频 文档 音乐
initial-setup-ks.cfg jdk-8u191-linux-x64.tar.gz original-ks.cfg 模板 图片 下载 桌面
[root@localhost ~]# mv jdk1.8.0_191/ /usr/local/java
[root@localhost ~]# rz -E
z waiting to receive.**B0100000023be50
[root@localhost ~]# ls
anaconda-ks.cfg epel-release-latest-7.noarch.rpm nginx-1.16.0.tar.gz 公共 图片 音乐
apache-tomcat-8.5.40.tar.gz initial-setup-ks.cfg original-ks.cfg 模板 文档 桌面 data
jdk-8u191-linux-x64.tar.gz website-1.0.1-1.x86_64.rpm 视频 下载
[root@localhost ~]# tar xf apache-tomcat-8.5.40.tar.gz
[root@localhost ~]# mv apache-tomcat-8.5.40 /usr/local/tomcat8
[root@localhost ~]# vim /etc/profile
在末尾添加
JAVA_HOME=/usr/local/java
PATH=$PATH:$JAVA_HOME/bin
[root@localhost ~]# source /etc/profile
[root@localhost ~]# java -version
openjdk version "1.8.0_181" //电脑自带的java版本
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
[root@localhost ~]# rm -rf /usr/bin/java //卸载电脑自带的旧版本
[root@localhost ~]# source /etc/profile //重新启动服务
[root@localhost ~]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
[root@localhost ~]# /usr/local/tomcat8/bin/startup.sh //启动脚本
Using CATALINA_BASE: /usr/local/tomcat8
Using CATALINA_HOME: /usr/local/tomcat8
Using CATALINA_TMPDIR: /usr/local/tomcat8/temp
Using JRE_HOME: /usr/local/java
Using CLASSPATH: /usr/local/tomcat8/bin/bootstrap.jar:/usr/local/tomcat8/bin/tomcat-juli.jar
Tomcat started.
[root@localhost ~]# netstat -anpt | grep :8080 //查看8080端口
tcp6 0 0 :::8080 :::* LISTEN 9968/java