I have a problem. I have two web apps deployed as wars. Let's call them app1.war
and app2.war
.
I would like app1.war
to be accessed at the URL www.website.com
and I would like app2.war
to be accessible as www.website.com/anotherapp
. I have my domain name ready.
Virtual hosting does not seem to help here.
I am running JBoss App Server 5.1 and Seam 2.2.0. I am working on integrating a forum (deployed as a war) with my app (deployed as another war) and therefore need to use single sign on and therefore would like the URL formats described above for easy passing of sso cookies.
Thanks for any insights.
-Charles.
You need to do such things:
Configure your JBoss to use virtual host with the www.website.com name.
You can do it by editing server.xml
from jbossweb.sar
directory. In short you have to set up another Host
directive.
You have to setup your war application. You can do it by creating or editing jboss-web.xml
file (it should be placed in WEB-INF
directory). In that file you can configure what virtual host should be used and under what context.
Example of that file for app1.war
<jboss-web>
<context-root>/</context-root>
<virtual-host>website</virtual-host>
</jboss-web>
Example of that file for app2.war
<jboss-web>
<context-root>/anotherapp</context-root>
<virtual-host>website</virtual-host>
</jboss-web>
More info you can find in that post Hosting Multiple Domains With JBoss
Haven't used JBoss in a while or Seam at all but if it's like most application servers there will be an XML file of some description where you match URL patterns to apps. Check you docs for details but I think you want web.xml and a few servlet entries like:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
Change the url-pattern and servlets accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With