| Dieser Inhalt in deutsch |

Debian Wheezy - SSL-Certificate for ownCloud

Problem

For ownCloud installation an SSL certificate has to be established to be able to establish connections over https

The comments there I have have changed because they were not working on my test system. The paths had to be different. I got the error message:
ssl_error_rx_record_too_long

Solution

Openssl has to be installed.

# apt-get install openssl
# cd /etc/ssl
# openssl req -new > server.cert.csr
# openssl rsa -in privkey.pem -out server.cert.key
# openssl x509 -in server.cert.csr -out server.cert.crt -req -signkey server.cert.key -days 365
Edit /etc/apache2/ports.conf
# nano /etc/apache2/ports.conf
Content
NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>

Activate Modul ssl

# a2enmod ssl

Reload configuration

# /etc/init.d/apache2 reload
/etc/apache2/sites-available/default - edit

Add at the end

<VirtualHost *:443>
ServerName localhost
DocumentRoot "/var/www"
SSLEngine on
SSLCertificateKeyFile /etc/ssl/server.cert.key
SSLCertificateFile /etc/ssl/server.cert.crt
</VirtualHost>
apache2 - reload configuration
# /etc/init.d/apache2 reload

or restart the service

# /etc/init.d/apache2 restart

Source

http://www.youtube.com/watch?v=j7C1xCmIQUA
http://www.sempervideo.de/https/