只输入域名就访问网站

<Host name="www.XXX.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Context path="" docBase="/usr/java/tomcat/webapps/项目名" debug="0"  reloadable="false" crossContext="true"/>
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>

      <Host name="IP地址"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Context path="" docBase="/usr/java/tomcat/webapps/项目名" debug="0"  reloadable="false" crossContext="true"/>
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>

      <Host name="admin.XXX.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Context path="" docBase="/usr/java/tomcat/webapps/项目名" debug="0"  reloadable="false" crossContext="true"/>
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>

二:将端口修改为80

<Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

 

posted @ 2017-07-11 19:20  孟夏草木长  阅读(653)  评论(0编辑  收藏  举报