Hard way of creating self-signed certificates

mkdir x509; cd x509
openssl genrsa -des3 -out ca.key 1024
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
openssl genrsa -des3 -out server.key 1024 
openssl req -new -key server.key -out server.csr 
./sign.sh server.csr

For the easy way, go here