Question

I have a JBoss instance which is behind a load balancer. To reach this instance we have a www.company.com domain. This domain points to Load Balancer and which in turn uses this jboss host to server pages. For this setup to function correctly we have had to change the server.xml file as

<Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
           connectionTimeout="20000" redirectPort="443"
           proxyName="www.comapny.com" proxyPort="80"/>

Now we have a requirement to have another URL (www.company2.com) point to the same server and both URL's must be operational.

Which would effectively mean that I would need another load balance and point the new URL to this new load balancer which in turn must use the old installation.

I have have been going through the JBoss documentation and could not find anything which could help me achieve this.

Is this even possible? If so how can this be done?

My server is running JBoss 5.1.0 GA

Était-ce utile?

La solution

To be honest, this turned out to be far more simple than I had initially imagined. Following two folks have explained this in so fine that details in their blog. So I am not trying to add anymore here.

http://www.fusioncube.net/index.php/hosting-multiple-domains-with-jboss http://www.openscope.net/2010/01/17/virtual-hosting-with-jboss/

This takes care of HTTP access to same deployment via different URL's

I do need to use https with 2 different signed certificates that I have. I am still searching for a solution to that (will update this answer as soon as i have one). But for folks using HTTP, above blogs are all they need to go through.

Autres conseils

One way to achieve this is by using Virtual IPs. Get two virtual IPs, one for each domain that would point to your load balancer. Then you can configure your load balancer to direct load to associated URI on that single JBoss server/port, based on the domain that was requested by the user. You may need to remove proxyName and proxyPort attribute from your tomcat config in this case.

Here's the high level request flow (hopefully with firewall somewhere in between as well),

Browser request for www.company1.com -> Virtual IP1 -> Load Balancer -> JBoss server IP:port/company1Site

Browser request for www.company2.com -> Virtual IP2 -> Load Balancer -> JBoss server IP:port/company2Site
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top