首先把下好的tomcat8.tar.gz放到服务器里,我用的Xftp放在了opt/software/java下 然后进入opt/software/java下
tar -zxvf apache=tomcat-8.0.33.tar.gz
然后进入tomcat目录bin目录
sudo vim catalina.sh
按i进入insert模式
加入
JAVA_HOME=/opt/software/java/jdk1.8.0_77
然后退出insert模式
sudo ./startup.sh
命令行刷出
Using CATALINA_BASE : /opt/software/java/apache-tomcat-8.0.33
Using CATALINA_HOME : /opt/software/java/apache-tomcat-8.0.33
Using CATALINA_TMPDIR : /opt/software/java/apache-tomcat-8.0.33/temp
Using JRE_HOME : /opt/software/java/jdk1.8.0_77
Using CLASS_PATH : /opt/software/java/apache-tomcat-8.0.33/bin/bootstarp.jar:/opt/software/java/apache-tomcat-8.0.33/bin/tomcat-juli.jar
Tomcat started.
然后打开xxx.xxx.xxx.xxx:8080
显示所用的tomcat信息,成功。