tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Turner <>
Subject Re: 2 VirtualHosts same IP address and port on Tomcat not working
Date Fri, 22 Aug 2003 12:15:39 GMT
David Wynter wrote:

> Hi,
> It seems that the second VirtualHost I have set up for my second domain name
> is not paasing the requests through mod_jk to Tomcat. It is not even clear
> that you can support 2 virtualhosts for different domains with the same IP
> address and port 80.
> This is a separate problem to the not redirecting to
> but it still affects me.

You can support many virtual hosts on the same IP address.  I have 
production environments with 6, 9, and 12 virtual hosts working just fine.

> Is the only way I can support a second virtual host is by setting up a
> second <Service> with its own Engine and Ajp13 connector listening on a
> separate port (say 8007 instead of 8009?). I assume I then setup a second
> worker on the port I have introduced. And in this case do both sevices also
> have a listener for port 8080, or do I need one on that port at all since
> all my trafic will be on port 80?

No, this is incorrect.  You only need one Service.

Your problems are related to your httpd.conf file, not the connector and 
not Tomcat.  You have to instruct Apache appropriately.  Its more than 
just JkMount, you also have to get your Alias and your DocumentRoot 
directives correct in httpd.conf...getting them wrong will cause Apache 
to "miss" the mod_jk match.

> I just tried it without a listener on port 8080, and a service with a
> connector on 8007 for one virtual host and a separate service with connector
> on 8009 for the other, nothing worked, so I suppose that answers my
> question.
> I am kinda surprised that on the whole internet there is not a configuration
> example of running different webapps on 2 domains on the same Tomcat
> instance, there must be hundreds of people doing it?

There are.  I've posted an example to this list twice in the past 4 
months or so.


View raw message