Apollo icon indicating copy to clipboard operation
Apollo copied to clipboard

HOWTO: configure HTTPS / SSL with webapollo + apache proxy

Open alpapan opened this issue 3 years ago • 1 comments

It took me a while but I figured a setup for serving a secure webapollo so that it can serve https://DOMAINAME instead of http://DOMAINAME without hicups.

DOMAINAME is basically what you provide in the virtualhost of apache.

<VirtualHost *:443>
    ServerName DOMAINAME

First, configuring Tomcat with a SSL connector and letsencrypt is a pain and unnecessary if you already use an apache proxy server. So follow the readthedoc instructions first.

Do not follow the SSL instructions as this is for Tomcat serving SSL.

Then edit Tomcat to let it know that you'll be serving via a proxy

The conf/server.xml requires the following two edits where DOMAINNAME is your domain name...

<Host name="DOMAINNAME"  appBase="webapps" unpackWARs="true" autoDeploy="true">

and

<Connector port="8082" protocol="HTTP/1.1" connectionTimeout="20000"
               redirectPort="8443"
                scheme="https" secure="true" proxyName="DOMAINAME" proxyPort="443" />

The last line above is the one that does the magic. Also to avoid complaints, the host name must be specified. I use a separate tomcat deployment for every webapollo installation so this would work.

The above will work and avoid the long polling that happens when viewing via HTTPS and it is not properly setup...

Tested with Ubuntu 20.04 with and 

Version: 2.6.2-SNAPSHOT
Grails version: 2.5.5
Groovy version: 2.4.4
JVM version: 1.8.0_265
Servlet Container Version: Apache Tomcat/9.0.31 (Ubuntu)
JBrowse config: 1.16.10-release
JBrowse url: https://github.com/gmod/jbrowse

openjdk 11.0.8 2020-07-14

alpapan avatar Oct 15 '20 11:10 alpapan

(NB: the above example used port 8082; default is 8080)

alpapan avatar Oct 15 '20 11:10 alpapan