JDK+tomcat安装

部署 jdk
[root@oldboy-tomcat ~]# tar xf /app/tools/jdk-8u241-linux-x64.tar.gz -C /app/
[root@oldboy-tomcat ~]# ln -s /app/jdk1.8.0_241/ /app/jdk
[root@oldboy-tomcat ~]# ll /app
total 0
lrwxrwxrwx 1 root root 18 Feb 7 10:26 jdk -> /app/jdk1.8.0_241/
drwxr-xr-x 7 10143 10143 245 Dec 11 18:39 jdk1.8.0_241
drwxr-xr-x 2 root root 75 Feb 7 10:13 tools

java jdk 环境变量
cat >>/etc/profile<<'EOF'
export JAVA_HOME=/app/jdk
export PATH=JAVA_HOME/jre/bin:CLASSPATH:JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar
export TOMCAT_HOME=/app/tomcat
EOF

说明部分

export JAVA_HOME=/app/jdk #jdk目录

export PATH=JAVA_HOME/jre/bin:$PATH #配置命令路径

export CLASSPATH=.JAVA_HOME/lib:JAVA_HOME/lib/tools.jar

export TOMCAT_HOME=/app/tomcat #tomcat 目录

[root@oldboy-tomcat ~]# . /etc/profile #或者source /etc/profile

03.检查 jdk是否部署完成

[root@oldboy-tomcat ~]# java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

部署 tomcat
[root@oldboy-tomcat ~]# tar xf /app/tools/apache-tomcat-8.5.50.tar.gz -C /app/
[root@oldboy-tomcat ~]# ln -s /app/apache-tomcat-8.5.50/ /app/tomcat

5 检查 jdk+tomcat
[root@oldboy-tomcat ~]# /app/tomcat/bin/version.sh
Using CATALINA_BASE: /app/tomcat
Using CATALINA_HOME: /app/tomcat
Using CATALINA_TMPDIR: /app/tomcat/temp
Using JRE_HOME: /app/jdk
Using CLASSPATH: /app/tomcat/bin/bootstrap.jar:/app/tomcat/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.5.50
Server built: Dec 7 2019 19:19:46 UTC
Server number: 8.5.50.0
OS Name: Linux
OS Version: 4.18.0-80.11.2.el8_0.x86_64
Architecture: amd64
JVM Version: 1.8.0_241-b07
JVM Vendor: Oracle Corporation

sed -i.bak '//d;/^$/d;//d' /app/tomcat/conf/server.xml
systemctl daemon-reload 重新读取配置文件

tomcat用户访问流程:
请求------>先确定端口到server.xml文件中找到匹配的端口---->在用户域名找到相关的域名

你可能感兴趣的:(JDK+tomcat安装)