Apache SSL

Generate a secure key for the domain:

$ openssl genrsa -out domain.key 1024

Generate a self-signed certificate:

$ openssl req -new -x509 -days 365 -key domain.key -out domain.crt

Generate a signed request if you want to have a valid certificate:

$ openssl req -new -key domain.key -out domain.csr

Submit the request to SSL certificate provider. Get signed certificate and save it to domain.crt.

Next, setup Apache2 to work with the certificate.

<VirtualHost domain:443>
  DocumentRoot "/srv/www/domain/secured"

  ServerName domain.tld:443
  SSLEngine on
  SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
  SSLCertificateFile    "/usr/local/apache2/conf/domain.crt"
  SSLCertificateKeyFile "/usr/local/apache2/conf/domain.key"
</VirtualHost>