Tips 4 developers by me :)

August 3, 2009

Setting up SSL for Plone with Apache 2

Filed under: Apache, IIS, Plone/Zope, Security — fehro @ 3:20 am

I was dreading having to do this as I recall what a pain IIS is to setup SSL with, however I was very wrong. Setting up Apache with SSL is far easier than I expected.

Firstly you require your SSL certificate. Mine was already stored in IIS (as it’s a wildcard one) so I first needed to export it following this guide http://www.petefreitag.com/item/16.cfm

I placed the server.key and cert.pem files in an folder called ssl off my Apache root directory.

Now you will need to enable the ssl mod in apache, this is done by running the following command:

sudo a2enmod ssl

I then added the following to my site configuration file in the sites-available folder.

<VirtualHost *:443>
        ServerName    myplonesite.com
        ServerAlias     www.myplonesite.com
        RewriteEngine   on
        RewriteRule     ^($|.*) http://localhost:8080/VirtualHostBase/https/%{SERVER_NAME}:443/myplonesite/VirtualHostRoot$1 [L,P]
        SSLCertificateFile /etc/apache2/ssl/cert.pem
        SSLCertificateKeyFile /etc/apache2/ssl/server.key
        SSLEngine on
</VirtualHost>

This should in theory be all that is required, if you navigate to your site with https://www.myplonesite.com your plone site should come up with no warning pop up about unsecure items. You shouldn’t ignore this message if you are getting it as if the user clicks no content may disappear from the page (plus it’s annoying and scares some users). I had a link to codebase for a flash movie causing my error message which just required me changing it’s url to https.

Blog at WordPress.com.