Skip to content

Instantly share code, notes, and snippets.

@jsven69gist
Created January 29, 2014 13:04
Show Gist options
  • Save jsven69gist/8687484 to your computer and use it in GitHub Desktop.
Save jsven69gist/8687484 to your computer and use it in GitHub Desktop.
Apache: SSL (https) configuration/setup on Ubuntu
SSL on Ubuntu
Install ss-cert package:
apt-get install ssl-cert
Activate ssl module on Apache2:
a2enmod ssl
Configure Apache2 for https:
a2ensite default-ssl
...or use it as basis
Add NameVirtualHost *:443 to ports.conf
And: change #<VirtualHost _default_:443> to <VirtualHost *:443> in default-ssl
You may need to add:
<VirtualHost *:80>
ServerName yourservername.yourdomain.com
Redirect / https://yourservername.yourdomain.com
</VirtualHost>
to 000-default in sites-enabled or something
Create your own (self-signed) certificate:
make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/meaningfullname.crt
You are promted for hostname which should be same hostname as ServerName in VirtualHost
Change SSLCertificateFile in config file to the name of the file created with full path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment