单ip单tomcat多域名配置

对tomcatserver.xml进行修改

<!—第一个域名—>

<Hostname="www.test1.com"appBase="webapps"

unpackWARs="true"autoDeploy="true">

<ContextdocBase="项目名称1"path=""reloadable="false"></Context>

<Valveclassname="org.apache.catalina.valves.AccessLogValve"directory="logs"

prefix="localhost_access_log."suffix=".txt"

pattern="%h%l%u%t&quot;%r&quot;%s%b"/>

</Host>

<!—第二个域名—>

<Hostname="www.test2.com"appBase="webapps"

unpackWARs="true"autoDeploy="true">

<ContextdocBase="项目名称2"path=""reloadable="false"></Context>

<Valveclassname="org.apache.catalina.valves.AccessLogValve"directory="logs"

prefix="localhost_access_log."suffix=".txt"

pattern="%h%l%u%t&quot;%r&quot;%s%b"/>

</Host>

相关推荐