-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

David,

On 3/4/14, 10:47 AM, David kerber wrote:
> On 3/4/2014 10:34 AM, André Warnier wrote:
>> 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.
> 
> Shutdown hook, maybe?  I just used my first one yesterday in a
> cmd-line java app...
> 
> 
>> 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 itself.
> 
> That was my reasoning as well, but I'm not as well-versed in this
> stuff as I would like to be.
> 
> 
>> 
>> 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 ?
> 
> That's what I was hoping Mark, Chuck or one of the other
> committers could answer definitively.

If you use "-1" as the shutdown port, it will be entirely disabled.
Come on, guys.. that's right in the documentation ;)

>>> 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).
> 
> That's what I thought.

There's nothing magical about port numbers: you can use them for
whatever you want. Most people expect HTTP to be available on 80 and
HTTPS to be available on 443. But if you have a reverse proxy
somewhere that uses those standard ports, you can use 1234 for HTTP
and 559 for HTTPS or whatever. Or 16234. Your choice.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTFiTHAAoJEBzwKT+lPKRYA/YP/i6Gn01NPI2+hKp6Q81Cc/80
jC/mLqEtLKPsb8d2bo79JFx4iV3zX0JJNGzOToISZisHxAvg+iZmIb1WLeVN4bK/
x56UT21ZahXnQt3tcpgxuLDySxH7Kn9qM3MSpdJrkTki8ukZIbbkiOadM55ieekS
uMu30qc2ivEZ4Iodd1Yyxg7Y+uzebsXlWYlnr8eno4Ph/v1Cf8z+nZTGXdjWF7f8
xMO55s/W4n1vpNRzLAv8mk1lJ5ThZwMjuQg2GyBEJK4gaWzxyQ4QrbWsAx1juKt5
zcNI9DQJMJQGOXNLB6MdiD5kXOhgGOU1j1WTFcAm/+v83gNukQYQv/X5m5Cwp6VW
X8Vzgv4BTlCPAxsd1YgsXCUrFm696pU5zSA3wWyTkvzfxJpVBfOyesQ2P+5aV7kk
+jxShzcbaK6yXISwPr7PWyo9oSxLmMbnNpGZAXsAm7wOHQUZnNygNOFBsaxDQvs/
bgI8Dz/4a8duwTyb9hiNn3Xr/KPh5359nMX8sfKX7vm1IjkKuLDeFYbp1EB0jnw2
KOS54lGNxdMJ62q9hzdBoztPDJnjcOnovheudHMX3blYla6ouRAueb3QrLopF1NT
SJ0fC2rEhohmSO8yROcXdkv0PVTWljWrSUKCXJ5Cj0SGqhj9YlYCKnXQ/qjTy0CX
C6MtQ2ltCH7uZDMjl23b
=3gTs
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to