- 下载并解压缩tomcat
[root@admin local]# cd /usr/local
[root@admin local]# wget http://apache.fayea.com/apache-mirror/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz
[root@admin local]# tar -zxv -f apache-tomcat-7.0.29.tar.gz // 解压压缩包
[root@admin local]# rm -rf apache-tomcat-7.0.29.tar.gz // 删除压缩包
[root@admin local]# mv apache-tomcat-7.0.29 tomcat
- 启动Tomcat
[root@admin ~]# /usr/local/tomcat/bin/startup.sh //启动tomcat
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/jre
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
- 开放8080端口
[root@admin ~]# vi + /etc/sysconfig/iptables
添加以下代码
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
重启防火墙
[root@admin java]# service iptables restart
检测Tomcat:访问 网址:8080
停止Tomcat
[root@admin ~]# /usr/local/tomcat/bin/shutdown.sh //停止tomcat
- 设置默认访问路径
方法1:
将项目改为ROOT
方法2:(建议使用这种方式)
<Context path="" docBase="D:\tomcat\webapps\项目文件夹名称" debug="0" reloadable="true" />
- 设置默认页面
<welcome-file-list>
<welcome-file>VideoManager</welcome-file>
</welcome-file-list>