I wrote a script for generating self-signed ssl server keys:
#!/bin/bash
openssl genrsa -out server.key -rand /dev/urandom:/dev/random 1024
echo "REMEMBER: Common name is the hostname of the server"
openssl rsa -in server.key -out server.pem
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 3655 -in server.csr -signkey server.key -out server.crt