tomcat相关

1、设置debug
[url]http://sw1982.iteye.com/blog/360154[/url]

2、用脚本杀死tomcat进程

APP_SERVER_NAME=apache-tomcat-6.0.32

#先shutdown
~/work/$APP_SERVER_NAME/bin/shutdown.sh
#杀死
pid=$(jps -v | grep /home/lisboa/work/$APP_SERVER_NAME/ |sed -n '1p' |awk '{print $1}');
if [ -n "$pid" ];
then
{
kill -9 $pid
sleep 3s
}
fi


3、web.xml设置error page
[b][color=red]注意:当配置了<exception-type>java.lang.Exception</exception-type>时,服务器出错日志是在tomcat的log里,这个需要注意[/color][/b]

<error-page>
<error-code>400</error-code>
<location>/error.htm</location>
</error-page>

<!-- 404 页面不存在错误 -->
<error-page>
<error-code>404</error-code>
<location>/error.htm</location>
</error-page>

<!-- 500 服务器内部错误 -->
<error-page>
<error-code>500</error-code>
<location>/error.htm</location>
</error-page>
<!-- java.lang.Exception异常错误,依据这个标记可定义多个类似错误提示 -->
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.htm</location>
</error-page>



4、设置welcome file

[b][color=red]注意:webroot下必须要有index.htm这个文件存在[/color][/b]

<welcome-file-list>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>


5、配置虚拟目录
 <Context path="/upload" docBase="D:\upload" reloadable="true" debug="0"></Context>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值