下载安装步骤
# 下载 openjdk 8
[root@server1 ~]# wget https://mirrors.huaweicloud.com/openjdk/java-jse-ri/jdk8u40/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz
# 下载 tomcat 8
[root@server1 ~]# wget https://mirrors.huaweicloud.com/apache/tomcat/tomcat-8/v8.5.56/bin/apache-tomcat-8.5.56.tar.gz
[root@server1 ~]# tar -xf apache-tomcat-8.5.56.tar.gz
[root@server1 ~]# mv apache-tomcat-8.5.56 /opt/tomcat
[root@server1 ~]# tar -xf openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz
[root@server1 ~]# mv openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz
# 设置环境产量
cat <<EOF >> /etc/profile
JAVA_HOME=/opt/java
PATH=\$JAVA_HOME/bin:\$JAVA_HOME/jre/bin:\$PATH
CLASSPATH=.:\$JAVA_HOME/lib:\$JAVA_HOME/jre/lib:\$JAVA_HOME/lib/tools.jar
TOMCAT_HOME=/opt/tomcat
EOF
# /opt/tomcat /opt/jdk
启动关闭 tomcat
# 开启
/opt/tomcat/bin/startup.sh
# 关闭
/opt/tomcat/bin/shutdown.sh
# 默认访问
curl localhost:8080