A document root per virtual host

I need WAS to use one set of html/jsp files when hitting one virtual host and another set when hitting another, e.g.
www1.mydomain.com/myApp -> /www1 files
www2.myDomain.com/myApp -> /www2 files
The context root has to be identical for both, if not I'd have made two webapps with each their document root, but WAS will not accept multiple webapps with the same context root.

So the question is whether and how it is possible to deploy my application so the document root is dependent on the virtual host.

Thanks!
nesrohtretepAsked:
Who is Participating?
 
nesrohtretepConnect With a Mentor Author Commented:
I solved the problem.
It was caused by my virtual hosts having an overlap in the defined aliases. When I removed the overlap, WAS accepted multiple webapps with identical context roots, with each their document root.
Thanks for your suggestion fozylet
0
 
fozyletCommented:
Inside the launch page you could check for the server address and redirect/forward accordingly.

the server address will be in the HTTP Server Variable HTTP_HOST
0
 
nesrohtretepAuthor Commented:
Yes that it possible, but I'd rather not have that logic in my application, I'd prefer to have it in the deployment information if possible. It is a plan B though.

0
 
nesrohtretepAuthor Commented:
My problem could also be solved by convincing WAS to allow two webapps with the same context root but different virtual hosts, is that possible?
0
 
fozyletCommented:
Haven't tried anything like that and can't really try right now. Sorry.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.