tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy <>
Subject Using the balancer app to redirect. Well, trying to
Date Tue, 09 Jan 2007 16:01:02 GMT

Sorry if this is a bit of a dumb question, but I just wondered if anyone 
had any handy hints for the problem below:

I'm trying to set up a tomcat 5.0.28 instance (on Debian)  to achieve 
redirecting accesses to through to, using 
the balancer app. rather than apache webserver and the AJP connectors.

The easiest solution would of course be just to set up a DNS level 
redirect on all port-80 accesses by putting in an A-name record to point 
at, but the problem is that doesn't have a 
direct IP, and you can't put the alphanumeric address in the DNS.

THe canonical way of doing it appears to be to set up apache webserver 
as a front-end to tomcat and manage it using webapp connectors like AJP, 
but apart from being a total pain to organise (and memory-hungry in my 
setup as well), that introduces the webapp connectors, which have caused 
problems with the applications I am running in the past.

Sooo.. what I have tried to do instead is be sneaky, and set up an 
instance of the tomcat balancer app on the server (by copying the 
balancer app instance in tomcat/webapps/ and slightly modifying the 
rules in the /config subdir) which redirect any access to anything at through to  
The machine that hosts the tomcat instance is set up in the DNS as the 
host for (in fact for all of and has a 
HOST container in server.xml, viz:

<Host name=""

        <Valve className="org.apache.catalina.valves.AccessLogValve"
          prefix="company_access_log." suffix=".txt"


and in <tomcat_root>/webapps there is an instance of the balancer app in 
a subdirectory called, with a config file set up to perform 
the necessary redirection for all accesses to anything at

This should work, as far as I can see.  however... although accesses to get successfully redirected to, 
this setup doesn't forward at all when the root domain is entered - ie 
browsing to or (with no antecedents) just 
results in a blank page.

I'm sure this used to work, and I've tried everything I can think of 
(including fiddling with the vhost definition in server.xml and the 
context fragment in webapps/ but I just 
can't make it respond to the root case.  Basically, what I'm trying to 
achieve is to get the root of the vhost instance defined in server.xml 
to call up the webapp at webapps/   Which you wouldn't have 
thought was that hard - but apparently it is!

The REALLY irritating thing is that I've solved this problem once 
already using pretty much the same setup, but can;t seem to get it to 
work again!
Anyone have any clues or hints or ideas (apart from using apache 
webserver and the AJP setup)? I'd be very grateful if so!



To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message