diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-02-15 12:11:29 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-02-15 12:11:29 +1100 |
commit | dad1e85c469c717db7aacc2c611ddf856542ffcd (patch) | |
tree | b7d4ebb4c5bb32f1b5ff9cb143719bb079ed3ed9 | |
parent | 64cb99eee83273cc9c70fa9094b75dc300026c84 (diff) |
Add a little documentation on how to set up apache as an SSL terminator
-rw-r--r-- | doc/INSTALL.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 3a911cbc8..d863f97e9 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -378,6 +378,34 @@ Under all but light loads, it is strongly recommended to run the server behind an http accelerator like Varnish. A sample varnish VCL is supplied in `../conf/varnish-alaveteli.vcl`. +It's strongly recommended that you run the site over SSL. (Set FORCE_SSL to true in +config/general.yml). For this you will need an SSL certificate for your domain and you will +need to configure an SSL terminator to sit in front of Varnish. If you're already using Apache +as a web server you could simply use Apache as the SSL terminator. A minimal configuration +would look something like this: + +<VirtualHost *:443> + ServerName www.yourdomain + + ProxyRequests Off + ProxyPreserveHost On + ProxyPass / http://localhost:80/ + ProxyPassReverse / http://localhost:80/ + RequestHeader set X_FORWARDED_PROTO 'https' + + SSLEngine on + SSLProtocol all -SSLv2 + SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM + + SSLCertificateFile /etc/apache2/ssl/ssl.crt + SSLCertificateKeyFile /etc/apache2/ssl/ssl.key + SSLCertificateChainFile /etc/apache2/ssl/sub.class2.server.ca.pem + SSLCACertificateFile /etc/apache2/ssl/ca.pem + SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown +</VirtualHost> + +Notice the line "RequestHeader" that sets the X_FORWARDED_PROTO header. This is important. This ultimately tells Rails that it's serving a page over https and so it knows to include that in any absolute urls it serves. + Some [production server best practice notes](https://github.com/mysociety/alaveteli/wiki/Production-Server-Best-Practices) are evolving on the wiki. |