linux下的tomcat安装与配置

本文介绍在CentOS 5.5 64位操作系统中安装配置JDK 7和Tomcat 7的过程,包括安装步骤、环境变量设置、防火墙关闭、项目部署及更改默认首页的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

当前使用版本:
    JDK:jdk-7u4-linux-x64.rpm
    Tomcat:apache-tomcat-7.0.27.tar.gz
    Centos 5.5 64位操作系统
1、将以下安装包拷贝至data0目录下
2、安装
    进入/data0
    执行rpm –ivh jdk-7u4-linux-x64.rpm  
    执行 tar zxvf apache-tomcat-7.0.27.tar.gz
         mv apache-tomcat-7.0.27 /usr/local/tomcat
3、配置
添加环境变量
    编辑文件/etc/profile
    在文件最后添加如下内容:
    export JAVA_HOME=/usr/java/jdk1.7.0_04
    export TOMCAT_HOME=/usr/local/tomcat
    保存退出   执行 source /etc/profile 使文件生效。
关闭防火墙
    chkconfig iptables off
    service iptables stop
启动tomcat
    将项目business拷贝至/usr/local/tomcat/webapps下
    编辑server.xml文件,添加
    <Context path="" docBase="/usr/local/tomcat/webapps/business" reloadable="true"/>
    保存退出。
    启动:/usr/local/tomcat/bin/startup.sh
    关闭:/usr/local/tomcat/bin/shutdown.sh
更改默认首页
    假如要更改的首页为loginFrm.html
    打开文件conf/web.xml,找到这段代码:
       <welcome-file-list> 
       <welcome-file>index.html</welcome-file> 
       <welcome-file>index.htm</welcome-file> 
       <welcome-file>index.jsp</welcome-file> 
       </welcome-file-list> 
    改成:
       <welcome-file-list> 
       <welcome-file>loginFrm.html</welcome-file> 
       <welcome-file>index.html</welcome-file> 
       <welcome-file>index.htm</welcome-file> 
       <welcome-file>index.jsp</welcome-file> 
       </welcome-file-list>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值