Here's how you can generate your own self-signed SSL certificates:
openssl genrsa 1024 > example.com.key
openssl req -new -key example.com.key -x509 -days 365 -out example.com.crt
Now that you've got a key and certificate (a .crt file), you can integrate them into Apache. This involves using the SSLCertificateFile and SSLCertificateKeyFile directives in your Apache configuration file that defines an HTTPS VirtualHost. You need to configure these directives to point to your certificate and key files, respectively. In my environment, this configuration goes into /etc/httpd/conf.d/ssl.conf ...
##
## SSL Virtual Host Context
##
<VirtualHost _default_:443>
...
SSLCertificateFile /path/to/crt/file/example.com.crt
SSLCertificateKeyFile /path/to/key/file/example.com.key
...
</VirtualHost>
Remember, your private key (your key file) is important. You should keep it in a secure/private place on your server, and not in a publicly readable directory.


Did you find this post helpful, or at least, interesting?