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