Ubuntu – Generating an SSL Certificate using OpenSSL for Apache

Run the following command:

openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key

 Reference