Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Same web app for a.mydomain.com & b.mydomain.com?

 
Joshua White
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to have a single instance of a web app respond to a.mydomain.com and b.mydomain.com?

I am looking to maintain only one code base, but brand/skin my site base on the url.

If this can't be done, is there a better way to do this?

Regards,

Joshua
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends what you mean by "have a single instance".

Can two different domain names share a single instance of a web application on disk?

Yes.

Will the different domains share the same in-memory instance of the application (in other words, will they share the same servlet context)?

No.

Be aware that if your app writes files to folders within the contextm that they could interfere with each other. I'm sure never to do such a thing.
 
Joshua White
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bummer. The only other way I can think of to solve this problem is passing a parameter arround (or at least initially) to indicate which company they are associated with.

I don't want to get into the business of deploying multiple copies of this app. Any other suggestions on how to solve this problem?

Regards,

Joshua
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a contrived example based upon virtual hosts set up in my Tomcat 5 setup:



Notice that both hosts have the same docbase. The hosts could also have idifferent doc bases, but have the context themselves resolve to shared web apps on the disc.
[ May 05, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bummer. ... Any other suggestions on how to solve this problem?


I'm not sure how my answer precludes your doing what you want to be doing given that you've stated that you will do the branding by URL detection.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Couldn't you look at the request with getServerName() and use different skins depending on the result?
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic