tomcat下载地址:https://tomcat.apache.org/
下载并解压到任意目录,我解压到了/usr/local/tomecat目录下
jdk下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html
下载并解压到任意目录,我解压到了/usr/local/tomecat目录下
vi /etc/profile
export TOMCAT_HOME=/usr/local/tomcat/apache-tomcat-10.0.27 #tomcat的所在路径
export CATALINA_HOME=/usr/local/tomcat/apache-tomcat-10.0.27 #不设置这个变量启动tomcat会报错,找不到setclasspath.sh
export JAVA_HOME=/usr/local/tomcat/jdk1.8
export CLASSPTH=/usr/local/tomcat/jdk1.8/lib/dt.jar:/usr/local/tomecat/jdk1.8/tools.jar
export PATH=/usr/local/tomcat/jdk1.8/bin:$PATH
source /etc/profile
chmod +x /usr/local/tomcat/jdk1.8/bin/java #启动tomcat时要用到,不提权会被拒绝
启动tomcat
/usr/local/tomcat/apache-tomcat-10.0.27/bin/startup.sh
查看8080端口如果处在监听说明启动正常,也可以通过浏览器访问 http://ipaddress:8080
如果没有处于监听状态或者启动时也没有明确的报错,可以通过以下目录查看日志排查问题
/usr/local/tomcat/apache-tomcat-10.0.27/logs
停止tomcat
/usr/local/tomcat/apache-tomcat-10.0.27/bin/shutdown.sh
标签:10.0,jdk1.8,tomcat,安装,usr,linux,apache,local From: https://www.cnblogs.com/hm1825/p/16778726.html