I'm in the process of speccing up a content management system for a private client. The client wants to be able to offer small business website hosting, and has approached me to write the CMS etc. No issues there.
What I want to do is write one web application, with the ability to dynamically add sites (within reason, I know one has to set up virtual hosts and the various DNS entries as well, but I want to try to automate the process as far as possible.)
Now say my client signs another client, test.com. I want to be able to serve up test.com's website and CMS data from the main application servlet on blah.com.
I know that tomcat has support for Aliases inside the Host element in server.xml - but I'm hoping that someone here knows whether I can register an alias, say www.test.com, which Tomcat will automatically be able to redirect to say www.blah.com/main?site=<siteID> or something to that effect.
What I've seen so far is that I can run www.test.com and www.blah.com off the same webapp via Alias, but I can't find a way to encode the site id of www.test.com in the alias itself.