1.
standalone.xml中修改:web
enable-welcome-root="true" 改成 falsesocket
<socket-binding name="http" port="80"/>server
2.
在第一个项目中添加jboss-web.xml(和web.xml一个目录)。xml
<?xml version='1.0' encoding='UTF-8' ?>
<jboss-web>
<context-root>/</context-root>
<virtual-host>YouthFortyA</virtual-host>
</jboss-web>io
第二个:
<?xml version='1.0' encoding='UTF-8' ?>
<jboss-web>
<context-root>/</context-root>
<virtual-host>YouthFortyB</virtual-host>
</jboss-web>module
依次...coding
3.
在standalone.xml文件中含有virtual-server的subsystem标签中添加如下内容:程序
<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>项目
依次...di
virtual-server name="YouthFortyA"中的YouthFortyA对应项目中jboss-web.xml的virtual-host。default-web-module="x"中x为x.war,即项目程序名称,Jboss会经过这个名称映射到对应的项目中去。alias name="xx.youthforty.com"中的xx.youthforty.com是项目网址。