Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE264D1BC for ; Wed, 22 Aug 2012 09:05:21 +0000 (UTC) Received: (qmail 70209 invoked by uid 500); 22 Aug 2012 09:05:18 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 69302 invoked by uid 500); 22 Aug 2012 09:05:14 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 69268 invoked by uid 99); 22 Aug 2012 09:05:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2012 09:05:13 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [217.146.183.238] (HELO nm8-vm0.bullet.mail.ukl.yahoo.com) (217.146.183.238) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 22 Aug 2012 09:05:04 +0000 Received: from [217.146.183.181] by nm8.bullet.mail.ukl.yahoo.com with NNFMP; 22 Aug 2012 09:04:43 -0000 Received: from [77.238.184.74] by tm12.bullet.mail.ukl.yahoo.com with NNFMP; 22 Aug 2012 09:04:43 -0000 Received: from [127.0.0.1] by smtp143.mail.ukl.yahoo.com with NNFMP; 22 Aug 2012 09:04:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s1024; t=1345626283; bh=zdR7YzmEIl/v5yWTrnQeQGtO9YCT0GH5SA0U9W7D6v0=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Antivirus:X-Antivirus-Status; b=2FT963HqIBJRjAfCiDGvxYVnn19U6nc2y29lbWCAt8BGf72avRSylWN+5q2rtQT8hz2IQ7gjIeLDev3s8tMCesnzahIVTSjvIzSikdqjXYR47YngxnHysZggG+wc3f1cAAHc4FJVNkyyYlgdiMXAO8O2FMSxYapag3gXO48QJbQ= X-Yahoo-Newman-Id: 855112.24631.bm@smtp143.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: rn.b7CoVM1mYCgYyZguXRuxv38WKmAQzXAz4wgQmSJ17fv0 Cn.esFysTdhcfav.YW4XXaWCUEWdpdjYKPd77V8D1i5vWWbZnnTvx1g3E7ye g0Dqzsz_oHOTytaJKiKz6CZFQ27zbidu1mkCHSFaUHAbrE6VSknwQq682w_l oL5FeOG5meKO8ErHFcPIB_FnQOuzYtcT9t2fFdMaoHMyvG20IIIUrm4mgSK9 drjjK7TtrXCY73DdnM0D1KdzX9l0st1puVdMO.F1RYY4fh_shdTYDVauqF_J rcHTzRsFxL1_2UjhVsUTrXCJTXHADTCNtapRRNnsAMQPoDr2Jj.gg3390MUB pB5yekXvU2sBhh9s72654tdmEE8ZIFxiZ4epq4gjYFCBOAVquFKgp60S_L5P 0TuUt42BkXT.bNkrpVA6pAzz2cAyHexqvdynFkFWhpXcMmnsV7whmJyurIBy DchRIzytS.OxuM5qfrFT1IhH_6qhyvq69E7p3P_Rj5khmJYX7C16Iv2DI.4D EFxd6yQ-- X-Yahoo-SMTP: 4morDKeswBDE3lIuzd.cm_qbJNxlcsznEWqdK4MN Received: from [127.0.0.1] (miguel_3_gonzalez@85.59.205.98 with plain) by smtp143.mail.ukl.yahoo.com with SMTP; 22 Aug 2012 09:04:43 +0000 GMT Message-ID: <5034A0A9.6050909@yahoo.es> Date: Wed, 22 Aug 2012 11:04:41 +0200 From: =?UTF-8?B?TWlndWVsIEdvbnrDoWxleiBDYXN0YcOxb3M=?= User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: redirecting people to maintenance mode References: <9283_1345458349_503210AD_9283_1227_1_50336231.4030205@yahoo.es> <5033A28B.6000500@christopherschultz.net> In-Reply-To: <5033A28B.6000500@christopherschultz.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 120821-0, 21/08/2012), Outbound message X-Antivirus-Status: Clean On 21/08/2012 17:00, Christopher Schultz wrote: > -----BEGIN PGP SIGNED MESSAGE----- > 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 and you can feel free to use any > technique (iptables, bind to 127.0.0.1, 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: > http://people.apache.org/~mturk/docs/article/ftwai.html 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 Miguel --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org