tomcat部署项目如何去掉项目名称

一般情况下我们部署完后访问的路径为http://127.0.0.1:8080/test/index.jsp,发布到Internet后路径为http://a.com.cn:8080/test/index.jsp,省略掉端口和默认首页后就为http://a.com.cn/test/,其中test为项目名称,如何省掉项目名称,让路径变为http://a.com

直接在tomcat的conf目录下的server.xml中<Host></Host>间加了一句
<Context path="" docBase="/fts" debug="0" reloadable="true"/>,
其中docBase="/fts"中的/fts是项目名字


<Context path="/" docBase="/disconf-web" debug="0" reloadable="true"/>

其中,path="/"必须是这个,而不能是path="" ,否则在启动tomcat的bin目录下startup.bat后,依然无法访问到项目

http://zhidao.baidu.com/question/328756773.html

猜你喜欢

转载自rd-030.iteye.com/blog/2321721
今日推荐