Enabling SSL support in Apache is a breeze. Heres how I did it:
Create the certificate. As root:
openssl genrsa -des3 -out server.key 1024
Enter a passphrase when prompted. Don’t forget it.
Create the CSR:
openssl req -new -key server.key -out server.csr
Enter your passphrase when prompted, and make sure the CN matches your hosts FQDN.
Self-sign the cert with:
openssl x509 -req -days 365 -in /root/server.csr -signkey /root/server.key -out /root/server.crt
Now, copy the key and the cert to apache’s installation directory:
cp server.* /usr/local/etc/apache22
Make the files readable by root only:
chmod 0400 /usr/local/etc/apache22/server.*
Edit httpd.conf and uncomment the line that reads:
Include etc/apache22/extra/httpd-ssl.conf
Restart Apache:
apachectl restart
You will now be prompted for your passphrase. To remove the password from the cert, do:
cd /usr/local/etc/apache22
openssl rsa -in server.key -out server.key
Enter your passphrase one last time. Start (or restart) Apache:
apachectl restart
Point your web-browser at your server, accept the cert. Thats all!