Lots of good info at
https://help.ubuntu.com/10.04/serverguide/C/certificates-and-security.html#creating-a-self-signed-certificate
If you get the error message
check to see whether you have a .md file in your home. If you do, delete it.