HTTPS for your testing environments | News | PHPro
What's new in our world

HTTPS for your testing environments

27 November 2011


  • Open your vhost and duplicate your port 80 configuration.
  • Change port 80 to port 443 in the new lines
  • Add the following lines for SSL

SLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

Snakeoil certificates and keys are tools used as placeholders for real certificates. They are installed with Ubuntu and are very useful for testing purposes. Despite their presence on most servers, they should be used in production.

  • Reload Apache

Run the command apache2ctl graceful (with root permissions). Before the connections are closed, active request will be completed.

Try reaching your website over HTTPS, this should work. If not run make-ssl-cert generate-default-snakeoil --force-overwrite, reload apache and try again.