Thursday, March 16, 2017

Adding an https certificate to ownCloud on FreeNAS 9


  1. Copy the certificate file (e.g. .crt) and the decrypted key file (e.g. .key.decrypted) to the jail in which ownCloud runs.

    cp {servername.crt,servername.key.decrypted} /mnt/tank/jails/owncloud_1/usr/pbi/owncloud-amd64/etc/apache24/
  2. Click on the Jails icon in the FreeNAS top menu, select the ownCloud jail (owncloud_1) and open a Shell by pressing the shell icon at the bottom.
  3. Edit the httpd-ssl.conf file in the 'extra' folder of the Apache config folder.

    vi /usr/pbi/owncloud-amd64/etc/apache24/extra/httpd-ssl.conf
  4. Change the value of the SSLCertificateFile setting.

    SSLCertificateFile "/usr/pbi/owncloud-amd64/etc/apache24/servername.crt"
  5. Change the value of the SSLCertificateKeyFile setting

    SSLCertificateKeyFile "/usr/pbi/owncloud-amd64/etc/apache24/servername.key.decrypted"
  6. Restart Apache

    /usr/pbi/owncloud-amd64/etc/rc.d/apache24 restart
The certificate should be working.