Skip to content

Instantly share code, notes, and snippets.

@Remiii
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Remiii/a1856393e84860c6f995 to your computer and use it in GitHub Desktop.
Save Remiii/a1856393e84860c6f995 to your computer and use it in GitHub Desktop.
How to setup HTTPS on Apache / Ubuntu

How to setup HTTPS on Apache / Ubuntu

$ sudo apt-get update
$ sudo apt-get install ssl-cert 
$ sudo a2enmod ssl
$ sudo service apache2 restart
$ sudo mkdir /etc/apache2/ssl

Create your own certif

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/domain.key -out /etc/apache2/ssl/domain.crt
Country Name : myCountryCode
State or Province Name (full name) [Some-State]: myState
Locality Name (eg, city) []: myCity
Organization Name (eg, company) [Internet Widgits Pty Ltd]: myCorp
Organizational Unit Name (eg, section) []: myCorpUnit
Common Name (e.g. server FQDN or YOUR name) []: yourDomain
Email Address []: myEmail

Buy a certif

http://serverfault.com/questions/599219/how-to-decide-where-to-purchase-a-wildcard-ssl-certificate

Generate the Chainfile Bundle

http://serverfault.com/questions/562369/how-to-install-multiple-intermediate-ca-certificate-files-on-apache

Apache conf

  # SSL CONFIG
  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/domain.crt
  SSLCertificateKeyFile /etc/apache2/ssl/domain.key
  SSLCertificateChainFile /etc/apache2/ssl/domain-chainfile-bundle.crt

Sources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment