1.首先安装jdk,并配置环境变量JAVA_HOME
2.下载tomcat:地址http://tomcat.apache.org/download-80.cgi
3.解压到安装目录:
$sudo tar zxvf apache-tomcat-x.x.x.tar.gz -C /opt
这里安装到/opt目录下
4.启动tomcat
$sudo /opt/apache-tomcat-x.x.x/bin/startup.sh
如果能看到下列提示,就表明启动成功了!
Using CATALINA_BASE: /opt/apache-tomcat-8.0.18
Using CATALINA_HOME: /opt/apache-tomcat-8.0.18
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.18/temp
Using JRE_HOME: /usr/lib/jvm/jdk1.7.0_75/jre
5、测试:打开浏览器,在地址栏中输入http://localhost:8080,如果出来Tomcat的缺省界面,说明测试通过!
6、停止Tomcat服务
$sudo /opt/apache-tomcat-x.x.x/bin/shutdown.sh