Discussion:
Multiple Hosts in server.xml - expected behaviour?
Stefan Mayr
2018-08-31 03:27:30 UTC
Permalink
Hi,

we got an application has multiple Service, Engine and Host entries in
server.xml. All Host sections share the same directory:

appBase="webapps"
unpackWARs="true"
autoDeploy="true"

Each host contains Context-Section using docBase="webapps/appX" for
diffenent applications appX.

Is this a valid configuration (for Tomcat 7.0)? If yes, what should we
expect to happen?

We currently see and endless loop of application deployments that fail
because the ports of the Service Connector is already in use.

Thank you,

Stefan Mayr

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Christopher Schultz
2018-08-31 17:22:01 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Stefan,
Post by Stefan Mayr
we got an application has multiple Service, Engine and Host entries
appBase="webapps" unpackWARs="true" autoDeploy="true"
Each host contains Context-Section using docBase="webapps/appX"
for diffenent applications appX.
Is this a valid configuration (for Tomcat 7.0)? If yes, what should
we expect to happen?
Yes, this is valid. You should expect that each <Host> will deploy a
separate copy of each web application found in "webapps". If you have
3 <Host>s and 3 web applications in "webapps", you should expect
Tomcat to start 9 separate contexts.
Post by Stefan Mayr
We currently see and endless loop of application deployments that
fail because the ports of the Service Connector is already in use.
Something else is wrong, then. Connectors are separate from context
(web app) deployments. Application deployments shouldn't attempt to
configure connectors.

Can you post an error and/or stack trace?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAluJeTkACgkQHPApP6U8
pFhErw/+IjS1+2OGuUVQgfnW31lssbUWvY7CiD8Dtz9JVe8I3bHWG9fI70ZHrPYW
ivSM9dJjMkSFMCW97kQl7ML5JPL+nG6c9kKxf23qhlH28iERh9hNs8A/iMk773u+
DnX7obBBRDeCECzz7q7bs19PnNjDwKaiuz50zRlEYEROZ59mRR4HhChbESwRw6da
Xk+JBdx8QsvjymfT4D0/g8HvjBvaI54cgqg7kmav41JxOvVQG8EHP2rLuNNxIHfF
OI7aF9XYUqQbu1qQgdp8H0pC7FsfJ9K4fKvobvf+vT6Ioel0RVVCIAngeimtBC/p
9/jGJKALCI4+HWVBvaW+XDhXnkGndpFQc8Vib2KqPLlv4nKSezG6LmDzHrm93irl
O9fkGVb8TMbZTNNLjw0TYOL5KXaR+121Mc//FjjzaLz7fpUPafXgcOKvAYsNueCd
O7C/yj0Yyxk+oUgQCtQLwh0rNPho1VgyypKdgEIemk5VksKcRIjMY4mf2hubnpMD
Af74btr9RAvLZFnlnBjSLzKG1+uoUKmxV6b4Yd4ll+HaBURTz4f3EWN7lJGAcdQh
ILLKW0v+StUHqujQ+pMlCWz5VxzlppRBQ60Pnij9qLYc+qzmGaFtAEOFzm1SqPbV
fyczJGwMrz8NMSXyBr3UDyXvCN9SPbswEh6/qAcnX9tLmuRQo6A=
=4TXL
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Stefan Mayr
2018-09-01 09:03:42 UTC
Permalink
Hi,
Post by Christopher Schultz
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Stefan,
Post by Stefan Mayr
we got an application has multiple Service, Engine and Host entries
appBase="webapps" unpackWARs="true" autoDeploy="true"
Each host contains Context-Section using docBase="webapps/appX"
for diffenent applications appX.
Is this a valid configuration (for Tomcat 7.0)? If yes, what should
we expect to happen?
Yes, this is valid. You should expect that each <Host> will deploy a
separate copy of each web application found in "webapps". If you have
3 <Host>s and 3 web applications in "webapps", you should expect
Tomcat to start 9 separate contexts.
Post by Stefan Mayr
We currently see and endless loop of application deployments that
fail because the ports of the Service Connector is already in use.
Something else is wrong, then. Connectors are separate from context
(web app) deployments. Application deployments shouldn't attempt to
configure connectors.
Can you post an error and/or stack trace?
- -chris
You were right. I started counting deployment log entries and failing
contexts. For each context we have n deploments, n being the number of
appBase definitions in Host entries. And because all of those apps seem
to bind additional local tcp ports we have n-1 failing contexts per
Host. Only the first one can bind that port. That led to a lot more
java.net.BindExceptions beeing thrown. I misinterpreted them to be
Connector ports.

Thank you,

Stefan

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

Loading...