Skip to content

Instantly share code, notes, and snippets.

@neight-allen
Created April 26, 2016 15:57
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 neight-allen/0776caf2279b0a4ee94e2faa3f90dbf0 to your computer and use it in GitHub Desktop.
Save neight-allen/0776caf2279b0a4ee94e2faa3f90dbf0 to your computer and use it in GitHub Desktop.
brew install letsencrypt
letsencrypt certonly --manual
# Enter your email
# Accept terms
# Enter 'localhost' as the domain
# Say 'No' to re-entering domain names

Let's Encrypt on Wordpress on digital ocean

  1. Buy a domain
  2. Create DO account
  3. Add SSH key
  4. Create wordpress container
  5. Point domain to docker container
  6. Log in via SSH
  7. Basic set up of wordpress
  8. clone letsencrypt
  9. Run letsencrypt
  10. Enter your domain name
  11. Go to wordpress admin and change site url to https

Let's Encrypt in Rails on digital ocean

  1. Create a Ruby on Rails droplet
  2. Needs to be 2GB
  3. Name it
  4. Put your SSH key there
  5. Point a subdomain to your droplet
  6. SSH into your droplet
$ ssh root@{IP_YOU_GOT_FROM_DIGITAL_OCEAN}
$ git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
$ cd /opt/letsencrypt
$ ./letsencrypt --nginx
$ /root/.local/share/letsencrypt/bin/pip install -U letsencrypt-nginx
  1. Continue through the warning
  2. Enter your full domain with subdomain
  3. Enter your email address
  4. Agree to the terms
  5. Choose Easy
  6. Go to your subdomain
  7. Now go to your subdomain with https:// at the front

Getting your code to run on this server

Changes to your codebase

  1. Add unicorn to your gemfile

Changes to your server config

  1. Copy the server section from ngnix.conf
server {
        server_name letsencrypt.neight.co;
        listen 443 ssl;
        ssl_certificate /etc/letsencrypt/live/letsencrypt.neight.co/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/letsencrypt.neight.co/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_trusted_certificate /etc/letsencrypt/live/letsencrypt.neight.co/chain.pem;
        ssl_stapling on;
        ssl_stapling_verify on;
    }
  1. Paste it at the bottom of sites-available/rails
nano sites-available/rails

https://www.ssllabs.com/ssltest/analyze.html?d=letsencrypt.neight.co

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