从文档上看是支持的,但具体我没有配过。Setting up Virtual Hosts with the JBoss/Tomcat-4.x bundleAs of the 2.4.5 release, support for virtual hosts has been added to the servlet container
layer. Virtual hosts allow you to group web applications according to the various DNS names
by which the machine running JBoss is known. As an example, consider the jboss.jcml
configuration fragment given in Listing 13-3. This configuration defines a default host
named localhost and a second host named banshee.starkinternational.com. The banshee.starkinternational.com also has the aliases www.starkinternational.com associated
with it.Listing 13-3, An example virtual host configuration.<!-- The embedded Tomcat-4.x(Catalina) service configuration -->
<mbean code="org.jboss.web.catalina.EmbeddedCatalinaServiceSX"
name="DefaultDomain:service=EmbeddedCatalinaSX">
<attribute name="Config">
<Server>
<Service name = "JBoss-Tomcat">
<Engine name="MainEngine" defaultHost="localhost">
<Logger className = "org.jboss.web.catalina.Log4jLogger"
verbosityLevel = "debug" category = "org.jboss.web.CatalinaEngine"/>
<DefaultContext cookies = "true" crossContext = "true" override = "true" />
<Host name="localhost">
<Logger className = "org.jboss.web.catalina.Log4jLogger"
verbosityLevel = "debug" category = "org.jboss.web.Host=localhost"/>
<Valve className = "org.apache.catalina.valves.AccessLogValve"
prefix = "localhost_access" suffix = ".log"
pattern = "common" directory = " ../server/default/log" />
</Host>
<Host name="banshee.starkinternational.com">
<Alias>www.starkinternational.com</Alias>
<Logger className = "org.jboss.web.catalina.Log4jLogger"
verbosityLevel = "debug" category = "org.jboss.web.Host=www"/>
<Valve className = "org.apache.catalina.valves.AccessLogValve"
prefix = "www_access" suffix = ".log"
pattern = "common" directory = " ../server/default/log" />
</Host>
</Engine>
<!-- A HTTP Connector on port 8080 -->
<Connector className = "org.apache.catalina.connector.http.HttpConnector"
port = "8080" minProcessors = "3" maxProcessors = "10" enableLookups = "true"
acceptCount = "10" connectionTimeout = "60000"/>
</Service>
</Server>
</attribute>
</mbean>When a WAR is deployed, it will be by default associated with the virtual host whose name
matches the defaultHost attribute of the containing Engine. To deploy a WAR to a specific
virtual host you need to use the jboss-web.xml descriptor and the virtual-host element. For
example, to deploy a WAR to the virtual host www.starkinternational.com virtual host alias,
the following jboss-web.xml descriptor would be need to be included in the WAR WEB-INF
directory. This demonstrates that an alias of the virtual host can be used in addition to the
Host name attribute value.Listing 13-4, An example jboss-web.xml descriptor for deploying a WAR to the www.starkinternational.com virtual host<jboss-web>
<context-root>/</context-root>
<virtual-host>www.starkinternational.com</virtual-host>
</jboss-web>When such a WAR is deployed, the server console shows that the WAR is in fact deployed to
the www.starkinternational.com virtual host as seen by the “Host=www” category name in
the log statements.