进入tomcat-->conf-->server.xml.
修改如下:
(1):将默认的端口8080修改成80
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
(2):
<Host name="域名" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/项目名称" debug="0"/> //直接输入域名就能访问该项目 例如: localhost
<Context path="/global" docBase="/另一个项目名称" debug="0"/> //输入域名+/global 例如:localhost/global
<!-- 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 -->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
-->
</Host>
版权声明:本文为博主原创文章,未经博主允许不得转载。