Skip to content

Instantly share code, notes, and snippets.

@drakakisgeo
Last active August 29, 2015 14:02
Show Gist options
  • Save drakakisgeo/d299d2f801d0c6e563bb to your computer and use it in GitHub Desktop.
Save drakakisgeo/d299d2f801d0c6e563bb to your computer and use it in GitHub Desktop.
Installation of Self Signed SSL in Ubuntu
### Commands that need Execution
- sudo apt-get install apache2 && a2enmod ssl && service apache2 restart && mkdir /etc/apache2/ssl
- sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
In the second command you can change the number of days. Here is one year only.
From The questions you see after executing the second command the most important is the "Common Name". I personally put my static ip there.
- sudo nano /etc/apache2/sites-available/default-ssl.conf
#### Do those changes
ADD -> ServerName YOURIP:443
MAKE SURE ITS NOT COMMENDED OUT -> SSLEngine on
ALTER THOSE LINES -> SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
Save & Exit
- sudo a2ensite default-ssl && service apache2 reload
DONE!
P.s.:Info was based in a blog post from Digital Ocean website (https://www.digitalocean.com/community/articles/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-12-04)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment