前提:要安装配置好jdk1.6+ 这里安装的是jdk1.7
下载tomcat
http://tomcat.apache.org/download-70.cgi
apache-tomcat-7.0.73.tar.gz
安装tomcat
将安装包传入/usr/local/下解压
[root@linux3 ~]# mv apache-tomcat-7.0.73.tar.gz /usr/local/
[root@linux3 ~]# cd /usr/local/
[root@linux3 local]# tar -zxvf apache-tomcat-7.0.73.tar.gz
[root@linux3 local]# mv apache-tomcat-7.0.73 tomcat
删除安装包
[root@linux3 local]# rm -rf apache-tomcat-7.0.73.tar.gz
启动tomcat
[root@linux3 local]# /usr/local/tomcat/bin/startup.sh
Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JRE_HOME:/usr/java/jdk1.7.0_79/jre
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
看到打印出以上内容 表示已经启动成功
测试tomcat
打开iptables的8080端口 或者关闭iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
打开浏览器(建议使用chrome或firefox)输入
http://192.168.1.122:8080/
出现tomcat系统界面 表示tomcat安装成功
关闭tomcat
[root@linux3 local]# /usr/local/tomcat/bin/shutdown.sh