首页 > 代码库 > 只输入域名就访问网站

只输入域名就访问网站

<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" />

 

只输入域名就访问网站