sudo apt-get update sudo apt-get install python-letsencrypt-apache sudo letsencrypt --apache -d example.com sudo letsencrypt --apache -d example.com -d www.example.com sudo crontab -e
hit enter and then paste this at the bottom of the config , save and exit.
30 2 * * 1 /usr/bin/letsencrypt renew >> /var/log/le-renew.log
add this to the .htaccess for redirects
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]