This content has been marked as final.
Show 1 reply
-
1. Re: One .war file and two different domains
emeuwese Jan 8, 2018 7:57 AM (in response to vished)One option is to build one ear for your application with two war modules.
Add to your subsystem undertow config in the profile your using a host for each domain for example example1-host with alias example1.com and example2-host width alias example2.com
<subsystem xmlns="urn:jboss:domain:undertow:4.0"> ... <server name="default-server"> ... <host name=example1-host" alias="example1.lan"> <filter-ref name="server-header" priority="1"/> <filter-ref name="x-powered-by-header" priority="1"/> </host> <host name="example2-host" alias="example2.lan"> <filter-ref name="server-header" priority="1"/> <filter-ref name="x-powered-by-header" priority="1"/> </host> </server> ... </subsystem>
Then add to the first war META-INF/jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?> <jboss-web xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_11_0.xsd" version="11.0"> <context-root>/</context-root> <virtual-host>example1-host</virtual-host> </jboss-web>
Then add to the second war META-INF/jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?> <jboss-web xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_11_0.xsd" version="11.0"> <context-root>/</context-root> <virtual-host>example2-host</virtual-host> </jboss-web>