You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Andrey Kartashov <an...@sonatainc.com> on 2001/05/04 16:43:22 UTC

Re: Tomcat 3.2.2 beta 4 (problem with shutdown code)

On Fri, May 04, 2001 at 09:26:35AM +0200, GOMEZ Henri wrote:
> >Hi, all!
> >I've made a little modification in Tomcat 3.2.1 codebase that 
> >I think would
> >be nice to include in TC 3.2.2.
> >
> >Problem: shutdown script always connects to "localhost" to 
> >send shutdown command.
> >It is a problem on a "multihomed" machine running multiple 
> >tomcats where
> >tomcats use same port numbers but bound to different IP 
> >adresses using inet=""
> >configuration option in server.xml.
> 
> Hey do you really want someone outside you machine send a shutdown
> command to your tomcats ? 
I think it is very common configuration where Ajp connector is 
bound to something other than "127.0.0.1".
Here are couple of examples: It is possible and some times desired to have
Apache web server load balance tomcat servers that run on physically different
machines; It is possible and some times useful to run mutiple Tomcat
instances on the same box that has multiple IP's (this may be good for
testing/developement).

> Warning, Warning here. The "localhost" is used here for security
I strongly disagree with this:) If you configure your Ajp connector to listen
to a particular interface someone _CAN_ send you shutdown command regardless
of your shutdown code abilities.

If you want security - you need to think about your network configuration,
not the shutdown code. This is what sys admins are for:)
A good example would be a machine that has multiple interfaces with
non-routable addresses (a developement machine) Or load balanced machines
behind the firewall.

I don't mean to enumerate all the possibilities here - this is just a few
examples.

> reasons. I didn't understand why your multihomed machine couldn't
> listen on localhost ?
> 
> Thanks to give us more informations, for example did you use multiples
> JVMs ?

Our configuration:
We have a developement machine with multiple interfaces running multiple
instances of Tomcat. It is behind the firewall. These different interfaces
have different internal DNS names and you can't hit them from outside:)

There are 2 ways to set up Tomcat here:
	1) All Ajp connectors bound to the same 127.0.0.1 but on different ports.
	2) Ports are the same but Ajp connectors are bound to different IP's

We prefer second case. Why? - It's a matter of taste&style.
The problem is that in this case shutdown code misbehaves as you may guess:)
Solution to this is very simple and I had it attached to previous E-Mail.


-- 
oo Andrey
oo
oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo
"All mail clients suck. This one just sucks less."
           -- http://www.mutt.org/  Jeremy Blosser
oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo