Virtual Hosts
robin.young Jun 6, 2011 6:14 AMI am in the process of attempting to upgrade from Jboss 4.2.2.GA to 6.0.0.Final.
I have an application that is registered using a context root of / using the following jboss-web.xml
<!DOCTYPE jboss-web PUBLIC
"-//JBoss//DTD Web Application 5.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
seam.jboss.org:loader=canopynet
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
<context-root>/</context-root>
<virtual-host>canopynet</virtual-host>
</jboss-web>
On 4.2.2.GA I simply changed /deploy/jboss-web.deployer/server.xml thus:
...
<Engine name="jboss.web" defaultHost="canopynet" jvmRoute="node1">
<Host name="localhost" autoDeploy="false" deployOnStartup="false" deployXML="false" configClass="org.jboss.web.tomcat.security.config.JBossContextConfig">
<Alias>homer</Alias>
...
</Host>
<Host name="canopynet" autoDeploy="false" deployOnStartup="false" deployXML="false" debug="2">
...
</Host>
...
Access to ROOT.war pages were limited to using localhost or homer as a host name if I used any other host name I would get my own app.
Things don't seem quite the same on JBoss 6.0.0.Final...
I have changed /deploy/jbossweb.sar/server.xml to match the Engine and Host definitions as above.
I have added the following jboss-web.xml to ROOT.war/WEB-INF
<?xml version="1.0"?>
<!DOCTYPE jboss-web PUBLIC
"-//JBoss//DTD Web Application 5.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>
<context-root>/</context-root>
<virtual-host>localhost</virtual-host>
</jboss-web>
I have similarly amended the jboss-web.xml of admin-console and jmx-console to add <virtual-host>localhost</virtual-host>.
Using the admin-console and looking at the traits section of the wars I can see:
My own app appears to have both the canopynet and localhost virtual hosts.
ROOT.war appears to have both the canopynet and localhost virtual hosts.
admin-console.war appears to be mapped to localhost only.
jboss-seam-booking.war appears to be mapped to localhost only.
When I access the server using any host name I get what is contained in the ROOT.war, I am unable to get to my own app.
Futhermore I can use any host to access /admin-console and /seam-booking.
Has the way to specify the defaultHost changed in Jboss 6?
Has the way to specify which virtual hosts and application should repsond to change in Jboss 6?