同一個tomcat下面放多個項目 每一個項目用不一樣的域名訪問

vim ./conf/server.conf

      <Host name="www.test1.com" debug="0"  appBase="/www/test1/webapps" ##這是war包存放的位置
            unpackWARs="true" autoDeploy="true" xmlValidation="false">
      <Context path="/" docBase="/www/test1/webapps"></Context> ##http訪問的位置
        <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="www.test2.com" debug="0"  appBase="/www/test2/webapps"
            unpackWARs="true" autoDeploy="true" xmlValidation="false">
      <Context path="/" docBase="/www/test2/webapps"></Context>
        <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>
# tree /www/
/www/
├── test1
│   └── webapps
│       └── index.html
└── test2
    └── webapps
        └── index.html

4 directories, 2 files
相關文章
相關標籤/搜索