1.关闭防火墙和selinux
setenforce 0
systemctl stop firewalld
2.下载jdk和Tomcat
cd /opt
wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.90/bin/apache-tomcat-8.5.90.tar.gz
wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz
3.解压
tar -zxvf apache-tomcat-8.5.90.tar.gz
tar -zxvf jdk-21_linux-x64_bin.tar.gz
4.jdk编辑配置文件
cd jdk-21.0.2/
vim /etc/profile
unset -f pathmunge之后添加:
export JAVA_HOME=/opt/jdk-21.0.2
export PATH=JAVA_HOME/bin:PATH
source /etc/profile(提示有问题不用管,直接进行下一步)
java(提示有问题不用管,直接进行下一步)
5.运行Tomcat脚本
cd ..
cd apache-tomcat-8.5.90/
cd bin/
./startup.sh 注意:这里手打不要复制
6.访问
192.168.233.132:8080