tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Hiller <>
Subject Re: RemoteHostValve for infinite domains? & Patch submit question...
Date Thu, 01 Apr 2010 16:45:04 GMT
yes, I have thought through all those actually.  Was just talking about
urlrewrite filter and apache this morning.  Issue with that then is having
to keep their company name in a param of every single redirect seam does
which is not the easiest of things to do....that way, company could be put
in front <company>

I like the ip idea(except for needing two tomcats).

Two services in tomcat doesn't work as then we would need different ports
which is definintely not something we want.

I decided I am going to go the route of finding that Host matching code
which probably looks up in a map of domain to Host object to route request
to the Host/Engine(*which file is that in so I can jump to it?*), and just
loop through it instead with endsWith.  *hmmm, too bad there is not a
pluggable component to Service or something or whoever owns the lookup like
in server.xml lookupClass="com.alvazan.tomcat.LookupHost" or something*?  I
could certainly provide a patch so people could plug into tomcat what they
like based on performance endsWith loop is not the best
if you have 400 domains on one tomcat.


On Thu, Apr 1, 2010 at 9:31 AM, André Warnier <> wrote:

> Dean Hiller wrote:
> ...
>> I need "two" for requests and one for
>> where xxxx is infinite combination.
>>  I think that you are right.  Based on the little I know about Java and
> Tomcat and RequestDispatcher, I would suggest a range of possible solutions,
> in my personal order of preference :
> 1) have a look at the urlrewrite filter at
> It may be able to do what you want.
> 2) use an Apache httpd with mod_rewrite and mod_proxy (or mod_jk) in front
> of Tomcat, as a proxy server listening on the IP address to which your
> hostnames resolve and port 80.
> Set up Tomcat to listen on another port (e.g.8080), and configure it with
> one default Host (localhost), and two additional Hosts (www.domain1.comand
> Use Apache's mod_rewrite to rewrite and proxy the calls to one or the other
> Tomcat Host(name), on the base of the domain ending of the original request.
> 3) get two different IP addresses for your server, and start 2 Tomcat
> instances, each one listening on one of these adresses.
> Each one would then have a default host, which will answer on all names
> which resolve to that IP.
> (Of course then you also need to split your two domains DNS-wise)
> There are different variations mixing and matching the above bits and
> pieces.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message