tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jaakko Taipale" <>
Subject VS: Tomcat configuration with multiple services
Date Tue, 03 Feb 2009 07:50:28 GMT
If I put two connectors under the same service like this:

  <Service name="Public">
   <Connector port="80" protocol="HTTP/1.1" 
               redirectPort="8443" />

	port="443" minSpareThreads="5" maxSpareThreads="75"
	enableLookups="true" disableUploadTimeout="true" 
	acceptCount="100"  maxThreads="200"
	scheme="https" secure="true" SSLEnabled="true"
	keystoreFile="/path/somekeystore" keystorePass="*********"
	clientAuth="false" sslProtocol="TLS"/>
   <Engine name="Public" defaultHost="">

 	<Host name="" appBase="httpapps"
       	unpackWARs="true" autoDeploy="true"
       	xmlValidation="false" xmlNamespaceAware="false"> 
	 <Host name="" appBase="httpsapps"
       	unpackWARs="true" autoDeploy="true"
       	xmlValidation="false" xmlNamespaceAware="false">

How can I force that users use https(or prevent http) when they access to I know I can make eg. httpsapps/ROOT/index.html
for redirecting user always to but
then I have to define "myapp" directory in url and still it is possible to
access my application via http(
That's why I have defined two different services. (The previous
configuration is working fine, but sometimes I have to restart tomcat twice
to get it running)


-----Alkuperäinen viesti-----
Lähettäjä: Caldarale, Charles R [] 
Lähetetty: 2. helmikuuta 2009 17:21
Vastaanottaja: Tomcat Users List
Aihe: RE: Tomcat configuration with multiple services

> From: Jaakko Taipale []
> Subject: Tomcat configuration with multiple services

> There is two services other for http and other for https connections. 
> Is this right way to do this

I've never seen anyone try that.  Can't imagine what your requirements would
be that result in having multiple <Service> elements in Tomcat.  One
normally simply has two <Connector> elements, one for HTTP, one for HTTPS:

> Also I point users accessing by ip to directory that doesn't exist 
> because I want that robots that are scanning ip addresses doesn't get 
> anything as response,

Lack of a valid appBase directory will cause a 500 response, not no
response, so that's pretty much a waste of time.

 - Chuck

MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

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

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

View raw message