tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Shutdown port on Windows Service installation
Date Tue, 04 Mar 2014 15:34:54 GMT
David kerber wrote:
> I am running several instances of TC 7 as services on a Windows Server 
> 2008 R2.  Each instance has its own set of ports, and I have both the 
> data port and shutdown ports configured in server.xml.  They are 
> currently running only HTTP.
> My questions:
> 1.  Does the shutdown port serve any purpose on a windows service 
> installation?  I thought I had read that it did not, but some searching 
> didn't turn up a definitive answer.

I don't really know either, but just for the fun of it, let's proceed by logical induction.

In a Windows Service scenario, the JVM that runs Tomcat, itself runs under a "wrapper" 
(tomcatX.exe).  That wrapper is a generic program for Java processes, and has no 
particular knowledge of Tomcat.  But it is that wrapper which would get the Windows 
message "Stop Service", and would have to forward this to the JVM in some way, to ask the

JVM itself to exit.
The JVM has no specific knowledge of Tomcat either, nor of its shutdown port and what it 
is there for.  So if the JVM must stop Tomcat before stopping itself, it must be doing it

via another way.
My guess would thus be that Tomcat inserts some "callback hook" in the JVM, so that it is

notified when the JVM has been asked to stop itself.  And when this callback is called by

the JVM, Tomcat initiates its own shutdown.  And when this callback returns, the JVM 
proceeds to shut itself down (or Tomcat just does a system.exit()).  And when that is 
done, the wrapper knows and can tell Windows that the Service is shut down, and then exit


Conclusion : no, the Tomcat shutdown port is not used when running as a Windows Service.

Now the question is : if you do not specify a shutdown port, does Tomcat nevertheless set

one up by default ?

> 2.  I may need to start using HTTPS for my data transfer for at least 
> one of the instances.  If that instance is going to allow only HTTPS 
> (and not HTTP), can I just make the current HTTP port into HTTPS?  

I cannot think of why not. You can comment out the HTTP Connector, and just leave the 
HTTPS Connector (and change its port).

Or do
> I need to configure an additional port?  If I need an additional port, 
> and the shutdown port isn't needed, I could just turn the shutdown port 
> into the HTTPS port, right?

You mean using the same port number, that you are currently using for the shutdown port ?

If so, yes, depending on the answer to the question above.
Note that this would not be the standard HTTPS port (443), so the clients would need to 
specifiy the port number explicitly, in addition to the "https://" prefix.
That may or may not bother you, depending on the scenario.

> I understand that there are significant configuration changes needed for 
> HTTPS, and will be back if I run into issues with it, but for now I'm 
> only asking about the TCP ports.
> Thanks!
> Dave
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message