February
6th,
2019
Let’s Encrypt recommends
that most people with shell access use the Certbot ACME client. It’s easy to use, works on many operating systems, and has great documentation.
We’ll follow this way of this tutorial. The platform we use is Debian with Apache, but I suppose instructions can be applied for others platforms.
Install CertBot Client
Certbot is meant to be run on the server where your website is hosted, then Log in the server and run following commands to install CertBot Client:
$ wget https://dl.eff.org/certbot-auto
$ chmod a+x certbot-auto
Generate Certificates
./certbot-auto certonly –webroot -w /var/www/html/ -d vps.meumobi.com -d ww.vps.meumobi.com
mkdir -p .well-known/acme-challenge/ echo -n “Testing acme-challenge” > /var/www/html/.well-known/acme-challenge/test sudo certbot renew –dry-run
Redirect for renewal
RewriteEngine On
ReweiteRule ^\.well-known\/acme-challenge\/ - [L]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://spucnottingham.org.uk/$1 [R=301,L]
mod_rewrite with exception
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !/page1/test
RewriteCond %{REQUEST_URI} !/page2
RewriteRule ^(.*)$ https://mywebsite.com/$1 [R,L]
https://stackoverflow.com/a/4021757/4982169