Ubuntu – ownCloud Secure Access with SSL
Enable ssl
sudo a2enmod ssl
Create new directory for the self signed certificate
sudo mkdir /etc/apache2/ssl
Create the self signed certificate and the server key that protects it, and placing both of them into the new directory
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/owncloud.key -out /etc/apache2/ssl/owncloud.crt
Now we setup the certificate
sudo nano /etc/apache2/sites-available/default-ssl.conf
The lines that need changing are the following
ServerName 192.168.1.11:443
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/owncloud.crt
SSLCertificateKeyFile /etc/apache2/ssl/owncloud.key
Activate the new vhost
sudo a2ensite default-ssl
Restart apache
sudo service apache2 restart