Advertisement
kohrVid

Let's Encrypt (Rails/Puma/NginX/AWS)

Nov 13th, 2015
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. I have set up Let's Encrypt on a Rails site hosted on a stand alone AWS server. This took me about two and half days to configure in part, due to issues I experienced with AWS but mostly due to the conflicting information I found online. I think that it may be worth adding specific instructions for AWS/Rails users or perhaps making changes to the Virtual Environment that can accommodate said users in future.
  2.  
  3. 1) Deploy the most recent version of the site to AWS Elastic Beanstalk. The Gemfile had to contain puma and rbenv.
  4. 2) sudo yum install git
  5. 3) sudo yum install libffi-devel
  6. 4) sudo yum install puppet
  7. 5) cd /var/app/current
  8. 6) git clone https://github.com/letsencrypt/letsencrypt
  9.  
  10. 7) ./letsencrypt-auto --server \
  11. https://acme-v01.api.letsencrypt.org/directory --help
  12.  
  13. 8) ./bootstrap/venv.sh
  14.  
  15. 9) ./letsencrypt-auto certonly \
  16. -a standalone \
  17. -d kohrvid.com \
  18. -d www.kohrvid.com \
  19. --server https://acme-v01.api.letsencrypt.org/directory \
  20. --agree-dev-preview --debug
  21.  
  22. Please note, my Let'sEncrypt installation required me to add the "--debug" flag because it believed I had python2.6 installed. The version of python on my ec2 server is 2.7.10.
  23.  
  24. 10) Two puma files were set up in /etc/init
  25. puma.conf can be found here --> http://pastebin.com/x2DwqgWM
  26. puma-manager.conf --> http://pastebin.com/4G84xY8j
  27.  
  28. 11) Delete /etc/nginx/
  29. 12) sudo yum remove nginx
  30. 13) sudo yum install nginx
  31. 14) In /etc/nginx/conf.d create a new file named “default.conf” which can be seen here --> http://pastebin.com/gCCUAYUd
  32. 15) Replace contents of /etc/nginx/nginx.conf with the following --> http://pastebin.com/iuWEHEnj
  33. 16) Replace contents of /etc/nginx/nginx.conf.default with the following --> http://pastebin.com/Z4z1c8nD
  34. 17) sudo start puma
  35. 18) sudo service nginx restart
  36.  
  37. At this point, it should be possible to load the site in a browser with an SSL certificate.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement