Virtual Hosts with JBoss AS 7

    JBoss AS 7 configuration of Virtual Hosts differs from previous versions.

    Open standalone/configuration/standalone.xml or domain/configuration/domain.xml and search for "virtual".

    You'll get to this subsystem:


    <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
        <connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/>
        <virtual-server name="default-host" enable-welcome-root="true">
            <alias name="localhost" />
            <alias name="" />


    This is the default host listeming on port 8080, serving ROOT.war at root context "/".


    To define other virtual hosts with your web app, don't forget to set default-web-module to a name of the web module, which is the name of the war without ".war" extension by default:


    <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="virtualServerName">
        <connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http"/>
        <virtual-server name="virtualServerName" default-web-module="nameOfWarModuleWithoutDotWar">
            <alias name=""/>
            <alias name=""/>


    For most recent and authoritative source of configuration options, see the XSD files in JBoss AS 7 sources:

    In our case, we are interested in web configuration definition:

    There you can see what everything you can use to configure for the <virtual-host> element.

    Documentation for these options may be available at .


    Also, per-WAR definition in your.war/WEB-INF/jboss-web.xml still works:




    Thanks to Marcio Dantas.