HOWTO+-+Replace+Apache+Default+Self+Signed+Certificates+on+Ubuntu

If you use Apache on Ubuntu with the default-ssl website (/etc/apache2/sites-available/default-ssl), performing the following set of commands will give you a new key/certificate

code format="bash" sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem code