tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miguel González Castaños <>
Subject Re: redirecting people to maintenance mode
Date Wed, 22 Aug 2012 09:04:41 GMT
On 21/08/2012 17:00, Christopher Schultz wrote:
> Hash: SHA1
> Miguel,
> On 8/21/12 6:25 AM, Miguel González Castaños wrote:
>> Dear all,
>> I have a Tomcat web server. From time to time, I need to do some
>> maintenance and want people not to interact with the Tomcat server
>> while I'm doing it. The key thing here is that the Tomcat server is
>> up and running. This is what I want to achieve:
>> - I want all people to be redirected from 80/443 port at server1 to
>> a different URL http://server2/maintenance.html except my IP
>> address (so I can check Tomcat myself).
>> - If possible, I want this to be transparent to the user, so they
>> get a http redirect showing the server1 in the client's browser,
>> not server2 (but this is not that important).
>> I assume I can use iptables to redirect people to a different web
>> server, but how can I know that I need to redirect them to the
>> maintenance.html if that server is serving other web pages too?
> I don't know if you want to add this kind of complication to your
> environment, but this is pretty much what mod_jk was built for:
> distributing requests to one or more back-end Tomcat servers.
> With mod_jk's management interface, you can take (load-balanced)
> workers out of a pool, upgrade them, then add them back to the pool.
> Before you add them back, you can always access them directly if you
> have set up an HTTP <Connector> and you can feel free to use any
> technique (iptables, bind to, etc.) to prevent direct access
> to the HTTP port from normal users.
> The use of Apache httpd out in front of your app server(s) also means
> that you can detect error conditions in the Tomcat instance (like it's
> crashed or whatever) and give a semi-nice error message instead of a
> connection failure.
> This is one of those situations where using Apache httpd out in front
> of Tomcat makes some sense: not for performance, but for availability.
> See Mladen's article with explains some of the why, what and how of
> setting up a mod_jk-based cluster:
It makes sense. I will give it a thought. Unfortunately until we migrate 
to a bigger server, I'm not sure the overhead of Apache is too much. 
Although I know Apache is faster for static content.

Many thanks for your thoughts


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message