参考声明:https://blog.csdn.net/qq_57389269/article/details/126239261
1、下载并上传Tomcat压缩包
2、解压至 /usr/local/tomcat 下
3、进入 apache-tomcat-9.0.65/bin 目录下
执行 chmod 777 ./* 命令将当前目录下的所有文件提至最高权限。
4、配置环境变量
[root@localhost ~]# vim /etc/profile
添加以下内容:
#tomcat
export TOMCAT_HOME=/usr/local/tomcat/apache-tomcat-9.0.65export CATALINA_HOME=/usr/local/tomcat/apache-tomcat-9.0.65
此外:
[root@localhost ~]# vim /usr/local/tomcat/apache-tomcat-9.0.65/bin/setclasspath.sh
添加以下内容:
export JAVA_HOME=/usr/local/java/jdk1.8.0_341
export JRE_HOME=${JAVA_HOME}/jre
5、开放8080端口
6、启动tomcat
进入 tomcat/bin 目录下执行 ./startup.sh 命令
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-9.0.65
Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-9.0.65
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-9.0.65/temp
Using JRE_HOME: /usr/local/java/jdk1.8.0_341/jre
Using CLASSPATH: /usr/local/tomcat/apache-tomcat-9.0.65/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-9.0.65/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
启动成功,可以访问:
标签:Tomcat,tomcat,9.0,配置,usr,Linux,apache,local,65 From: https://www.cnblogs.com/javaxubo/p/16862798.html