本文共 3218 字,大约阅读时间需要 10 分钟。
下载如下版本
下载完后,可以用xftp上传到linux系统里上传完成[root@taoyuan src]# lsjdk-8u161-linux-x64.tar.gz
#解压[root@taoyuan src]# tar zxvf jdk-8u161-linux-x64.tar.gz #移动并修改目录名称[root@taoyuan src]# mv jdk1.8.0_161/ /usr/local/jdk1.8
[root@taoyuan src]# vi /etc/profile#最后增加如下内容JAVA_HOME=/usr/local/jdk1.8/JAVA_BIN=/usr/local/jdk1.8/binJRE_HOME=/usr/local/jdk1.8/jrePATH=$PATH:/usr/local/jdk1.8/bin:/usr/local/jdk1.8/jre/binCLASSPATH=/usr/local/jdk1.8/jre/lib:/usr/local/jdk1.8/lib:/usr/local/jdk1.8/jre/lib/charsets.jar[root@taoyuan src]# source /etc/profile#刷新
[root@taoyuan src]# java -versionjava version "1.8.0_161"Java(TM) SE Runtime Environment (build 1.8.0_161-b12)Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)#当执行该命令,显示版本号,表示配置没有问题
#下载二进制软件包[root@taoyun src]# wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.24/bin/apache-tomcat-8.5.24.tar.gz
[root@taoyun src]# tar zxvf apache-tomcat-8.5.24.tar.gz [root@taoyun src]# mv apache-tomcat-8.5.24 /usr/local/tomcat#启动[root@taoyun src]# /usr/local/tomcat/bin/startup.shUsing CATALINA_BASE: /usr/local/tomcatUsing CATALINA_HOME: /usr/local/tomcatUsing CATALINA_TMPDIR: /usr/local/tomcat/tempUsing JRE_HOME: /usr/local/jdk1.8Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jarTomcat started.#查看进程[root@taoyun src]# ps aux |grep javaroot 1634 1.8 5.5 2998492 104000 pts/0 Sl 15:52 0:04 /usr/local/jdk1.8/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap startroot 1684 0.0 0.0 112676 980 pts/0 S+ 15:55 0:00 grep --color=auto java#关闭Tomcat的命令[root@taoyuan src]# /usr/local/tomcat/bin/shutdown.sh Using CATALINA_BASE: /usr/local/tomcatUsing CATALINA_HOME: /usr/local/tomcatUsing CATALINA_TMPDIR: /usr/local/tomcat/tempUsing JRE_HOME: /usr/local/jdk1.8Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
说明: Tomcat不支持restart,如果更改其配置文件,只能先关闭再启动。
[root@taoyun src]# netstat -lntp |grep javatcp6 0 0 :::8080 :::* LISTEN 1634/java tcp6 0 0 127.0.0.1:8005 :::* LISTEN 1634/java tcp6 0 0 :::8009 :::* LISTEN 1634/java
三个端口
端口8080:提供web服务的
端口8005:管理端口端口8009:第三方服务调用端口(如:httpd和Tomcat结合时会用到)转载于:https://blog.51cto.com/3622288/2063018