1.修改shutdown字符为复杂字符。
方法如下:编辑tomcat的conf文件夹下的server.xml,
把<Server port="8005" shutdown="SHUTDOWN">
修改为<Server port="8005" shutdown="QWEasd">
2.设置错误页面
编辑tomcat的conf文件夹下的web.xml,在</welcome-file-list>
后添加
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>404</error-code>
<location>/404.htm</location>
</error-page>
<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/error.jsp</location>
</error-page>
然后将404.htm和error.jsp文件拷贝到项目根目录下面即可
其他400,403,500也类似404这样操作。
3.修改应用部署的目录
编辑tomcat的conf文件夹下的server.xml,
把
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
中的appBase修改为
<Host name="localhost" appBase="/opt/projects"
unpackWARs="true" autoDeploy="true">
appBase的目录按自己要求来修改。