I'm using Jetty, not Tomcat. I found a solution using an Apache front end and mod_proxy_html. It took a lot of experimentation to get it right since a lot of the answers didn't deal with stylesheets and the like.
<IfModule mod_proxy.c> ProxyRequests Off ProxyPass / http://localhost:8888/blog/ ProxyPassReverse / http://localhost:8888/blog/ ProxyHTMLExtended On ProxyHTMLURLMap http://localhost:8888/blog/ / ProxyHTMLURLMap /blog/ / </IfModule> If you don't have the second line you'll see the blog but not the stylesheets. I also discovered that the default proxy_html.conf file (at least under ubuntu) needs to be commented out. The default values were causing problems. On Sun, Nov 15, 2009 at 7:21 PM, ALAA MURAD <[email protected]> wrote: > I think you can do that from your Tomcat server.xml config file , I used to > do that with OpenCMS to support multiple domains. > > OK this is NOT a working solution but you can actually have first.comlinked > main.com's context (I really don't remember how to do it correctly ) but > this what where you need to start your search. running tomcat virtual host > is very costly idea ! you may also try to use url rewrite in apache and I > know there is one for tomcat. Please let me know how you did. > > <Host deployXML="true" name="main.com" debug="0" > appBase="/var/www/vhosts/main.com/httpdocs" > unpackWARs="true" > autoDeploy="true" liveDeploy="true"> > > <Context path="/roller" docBase="/var/www/vhosts/ > main.com/httpdocs/roller" debug="1" /> > ... > </Host> > > <Host deployXML="true" name="first.com" debug="0" > appBase="/var/www/vhosts/main.com/httpdocs" > unpackWARs="true" > autoDeploy="true" liveDeploy="true"> > > <Context path="/roller" docBase="/var/www/vhosts/ > main.com/httpdocs/roller" debug="1" /> > ... > </Host> > > > > > > On Sun, Nov 15, 2009 at 5:21 PM, Bear Giles <[email protected]> wrote: > > > I'm trying to avoid that hit (one instance per domain). It's not that > bad > > for me since at most I'll only have a few users with vanity domains but I > > thought there could be another solution for sites with hundreds of such > > domains. > > > > Bear > > > > > > On Sat, Nov 14, 2009 at 11:28 PM, Horatia <[email protected]> wrote: > > > > > The easiest way is: tomcat virtual host with a roller instance for each > > > domain. > > > > > > Horatia > > > > > >
