On 29 April 2016 at 14:57, André Warnier (tomcat) <a...@ice-sa.com> wrote:
> On 29.04.2016 12:52, Lyallex wrote:
>>
>> On 29 April 2016 at 08:44, André Warnier (tomcat) <a...@ice-sa.com> wrote:
>>>
>>> On 29.04.2016 08:59, Lyallex wrote:
>>>>
>>>>
>>>> The problem is despite setting the to-type to permanent-redirect I'm
>>>>>>
>>>>>>
>>>>>> actually getting a 302 temporary-redirect.
>>>>>>
>>>>>> I know this is probably off topic but if anyone has any experience of
>>>>>> this I'd be gratefull to hear how you solved it
>>>>>>
>>>
>>> If this was Apache httpd, a simple solution would be to create 2
>>> VirtualHost's,
>>> - one of which listens only to port 80, and always returns a 301 to HTTPS
>>> - the other one listening only to port 443, and holding your application
>>> There should be a way to do the same with Tomcat.

I am but a humble code monkey and certainly no Tomcat guru
but I think I understand where you are coming from

I commented out the relevant constraint in web.xml
commented out the standard port 80/443 setup in server.xml
commented out the redirect rule in urlrewrite.xml

I added the following to server.xml and started tomcat

<Connector port="443" protocol="HTTP/1.1" connectionTimeout="20000"
maxThreads="150" scheme="https" secure="true"
               SSLEnabled="true" keystoreFile="/opt/keys/tomcat.keystore"
               keystorePass="l00byl00" clientAuth="false"
keyAlias="tomcat" sslProtocol="TLS" />

I checked out the logs and couldn't see any problems, tomcat was
apparently listening on 2 ports

Apr 29, 2016 4:10:37 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-443"]
Apr 29, 2016 4:10:37 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Apr 29, 2016 4:10:37 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2167 ms

I fired up frefox, cleared the caches and entered https;//localhost
and the site was visible ... I haven't tested it extensively but it
seems to work fine

Of course the problems start when I try http://localhost given that
there's nothing listening on port 80

I think this is where your second instance comes in ... I'll go and do
some gardening and let my tired old brain process what you said and
see if I can make it work.

Do any of the gurus want to jump in here
what do you think of this solution

Is it madness, what haven't I seen

Thanks for your time

snip

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

Reply via email to