tomcat 的server.xml配置
<Enginename="Catalina"defaultHost="localhost">
<!--注:这里默认的host是localhost,如果通过http://ip:8080/访问会访问到localhost-->
<Realmclassname="org.apache.catalina.realm.UserDatabaseRealm"
resourcename="UserDatabase"/>
<Hostname="localhost"appBase="webapps"
unpackWARs="true"autoDeploy="true"
xmlValidation="false"
xmlNamespaceAware="false">
</Host>
<Hostname="www.xn_test.com"appBase="/home/web/xiaonei"
unpackWARs="true"autoDeploy="true"
xmlValidation="false"xmlNamespaceAware="false">
<ContextdocBase="/home/web/xiaonei"path="/"
privileged="true"
antiResourceLocking="false"
antiJARLocking="false"
autodeploy="true">
</Context>
</Host>
<Hostname="www.xn_test2.com"appBase="/home/web/xiaonei2"
unpackWARs="true"autoDeploy="true"xmlValidation="false"
xmlNamespaceAware="false">
<ContextdocBase="/home/web/xiaonei2"path="/"
privileged="true"antiResourceLocking="false"
antiJARLocking="false"autodeploy="true">
</Context>
</Host>
</Engine>
http://www.xn_test.com:8080/
http://www.xn_test2.com:8080/