1.
Modified in Standalone.xml:
Enable-welcome-root= "true" to False
<socket-binding name= "http" port= "/>"
2.
In the first project, add Jboss-web.xml (and Web. XML a directory).
<?xml version= ' 1.0 ' encoding= ' UTF-8 '?>
<jboss-web>
<context-root>/</context-root>
<virtual-host>YouthFortyA</virtual-host>
</jboss-web>
The second one:
<?xml version= ' 1.0 ' encoding= ' UTF-8 '?>
<jboss-web>
<context-root>/</context-root>
<virtual-host>YouthFortyB</virtual-host>
</jboss-web>
In turn ...
3.
Add the following to the subsystem tag that contains virtual-server in the Standalone.xml file:
<virtual-server name= "Youthfortya" default-web-module= "x" >
<alias name= "x.youthforty.com"/>
</virtual-server>
<virtual-server name= "Youthfortyb" default-web-module= "x" >
<alias name= "xx.youthforty.com"/>
</virtual-server>
In turn ...
Virtual-server jboss-web.xml virtual-host in Youthfortya corresponding project in Name= "Youthfortya".
default-web-module= x in "X" is X.war, which is the project program name, JBoss will map to the corresponding project by this name.
The xx.youthforty.com in alias Name= "Xx.youthforty.com" is the project URL.
JBOSS7 Virtual host configuration and input domain name direct access to the project (configure multiple two-level domain names)