[root@localhost ~]# cd /opt [root@localhost opt]# ls apache-tomcat-8.5.63.tar.gz jdk-8u281-linux-aarch64.tar.gz [root@localhost opt]# tar -zxvf jdk-8u281-linux-aarch64.tar.gz -C java tar: java:无法 open: 没有那个文件或目录 tar: Error is not recoverable: exiting now [root@localhost opt]# mkdir java [root@localhost opt]# tar -zxvf jdk-8u281-linux-aarch64.tar.gz -C java
解压Tomcat的压缩包
创建tomcat目录,然后将tomcat的压缩包解压到这个/opt/tomcat目录中:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[root@localhost opt]# ls apache-tomcat-8.5.63.tar.gz java jdk-8u281-linux-aarch64.tar.gz [root@localhost opt]# mkdir tomcat [root@localhost opt]# tar -zxvf apache-tomcat-8.5.63.tar.gz -C tomcat/ apache-tomcat-8.5.63/conf/ apache-tomcat-8.5.63/conf/catalina.policy ...... apache-tomcat-8.5.63/bin/tool-wrapper.sh apache-tomcat-8.5.63/bin/version.sh [root@localhost opt]# ls apache-tomcat-8.5.63.tar.gz java jdk-8u281-linux-aarch64.tar.gz tomcat [root@localhost opt]# cd tomcat/ [root@localhost tomcat]# ls apache-tomcat-8.5.63
配置环境
配置java环境
获取JDK绝对路径
进入jdk根目录,获取jdk根目录的绝对路径:
1 2 3 4 5 6 7 8 9 10
[root@localhost opt]# ls apache-tomcat-8.5.63.tar.gz java jdk-8u281-linux-aarch64.tar.gz tomcat [root@localhost opt]# cd java [root@localhost java]# ls jdk1.8.0_281 [root@localhost java]# cd jdk1.8.0_281/ [root@localhost jdk1.8.0_281]# ls bin COPYRIGHT include jre legal lib LICENSE man README.html release src.zip THIRDPARTYLICENSEREADME.txt [root@localhost jdk1.8.0_281]# pwd /opt/java/jdk1.8.0_281
[root@localhost opt]# cd tomcat85 [root@localhost tomcat85]# ls bin BUILDING.txt conf CONTRIBUTING.md lib LICENSE logs NOTICE README.md RELEASE-NOTES RUNNING.txt temp webapps work
启动Tomcat
/opt/tomcat85/startup.sh
1 2 3 4 5 6 7 8 9
[root@localhost opt]# /opt/tomcat85/bin/startup.sh Using CATALINA_BASE: /opt/tomcat85 Using CATALINA_HOME: /opt/tomcat85 Using CATALINA_TMPDIR: /opt/tomcat85/temp Using JRE_HOME: /opt/java/jdk1.8.0_281/jre Using CLASSPATH: /opt/tomcat85/bin/bootstrap.jar:/opt/tomcat85/bin/tomcat-juli.jar Using CATALINA_OPTS: Tomcat started. [root@localhost opt]#
[root@localhost opt]# /opt/tomcat85/bin/startup.sh Using CATALINA_BASE: /opt/tomcat85 Using CATALINA_HOME: /opt/tomcat85 Using CATALINA_TMPDIR: /opt/tomcat85/temp Using JRE_HOME: /opt/java/jdk1.8.0_281/jre Using CLASSPATH: /opt/tomcat85/bin/bootstrap.jar:/opt/tomcat85/bin/tomcat-juli.jar Using CATALINA_OPTS: Tomcat started. [root@localhost opt]# /opt/tomcat85/bin/shutdown.sh Using CATALINA_BASE: /opt/tomcat85 Using CATALINA_HOME: /opt/tomcat85 Using CATALINA_TMPDIR: /opt/tomcat85/temp Using JRE_HOME: /opt/java/jdk1.8.0_281/jre Using CLASSPATH: /opt/tomcat85/bin/bootstrap.jar:/opt/tomcat85/bin/tomcat-juli.jar Using CATALINA_OPTS: [root@localhost opt]#