I was asked to upgrade a server running Apache and Tomcat-6 on Debian Wheezy from HTTP to HTTPS. I have successfully obtained and install SSL certificates on the Apache part and checked that they work (using two different SSL checkers).
Next, I have added the following block to /etc/apache2/sites-available/default-ssl
:
<VirtualHost *:80>
ServerName server.name
Redirect permanent / https://server.name/
</VirtualHost>
and this to the end of the <VirtualHost _default_:443>
block in the same file:
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
On the Tomcat side, the /etc/tomcat6/server.xml
file includes two active connectors:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
<Connector address="127.0.0.1" port="8009" protocol="AJP/1.3" redirectPort="8443" />
Now, when I go to https://server.name/app/main/login.jspx
, I get an SSL connection, but it disappears after login.
If I go to https://server.name/app
, I am immediately redirected to http://server.name/app/main/login.jspx
(no SSL).
(And if I go to just https://server.name/
, I end up on a redirect page defined in /var/lib/tomcat6/webapps/ROOT/index.html
.)
What am I doing wrong? Do I need to use the AJP proxy instead?