您的位置:首页 > 运维架构 > Tomcat

tomcat去掉项目名称访问项目配置

2018-01-05 11:06 441 查看
在tomcat目录中找到server.xml文件,打开文件并找到<Host
>向其中添加

<Context   path=""   docBase="F:/workplace/p1/WebRoot"   debug="0"/> 

docBase是项目的绝对路径,如下所示:

<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->

<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/>
<Context docBase="D:\eclipse-jee-neon\apache-tomcat-8.0.37\wtpwebapps\OfficialWebsite" path="" reloadable="true" debug="0"/>
<Context docBase="E:\result" path="/result" reloadable="true"/>
<Context docBase="D:\eclipse-jee-neon\apache-tomcat-8.0.37\wtpwebapps\OfficialWebsite" path="/OfficialWebsite" reloadable="true" source="org.eclipse.jst.j2ee.server:OfficialWebsite"/>
</Host>重启Tomcat
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: