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.
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.
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.
Right, that's what I thought.
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.
That is expected in this particular scenario; it's an automated data
collection system with no human interface. The http port is also
non-standard.
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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org