certbot
Install
1 wget https://dl.eff.org/certbot-auto
2 sudo mv certbot-auto /usr/local/bin/certbot-auto
3 sudo chown root /usr/local/bin/certbot-auto
4 sudo chmod 0755 /usr/local/bin/certbot-auto
5 certbot-auto
Get cert to domain www.example.org (nginx)
1 /usr/local/bin/certbot-auto certonly --webroot
2
3
4
5
6
7 cd /etc/letsencrypt/live/www.example.org/
8 cat cert.pem > www_ca_bundle.crt
9 echo "" >> www_ca_bundle.crt
10 cat chain.pem >> www_ca_bundle.crt
11 cp privkey.pem /etc/ssl/private/www_private.key
12 cp www_ca_bundle.crt /etc/ssl/certs/www_ca_bundle.crt
13 nano /etc/nginx/sites-enabled/www.example.org
14
15
16
17 service nginx restart
Get cert to domain using other webroot
1 cd /etc/nginx/sites-available
2 cp other.example.org other.example.org.ori
3 cp www.example.org other.example.org
4 sed -i 's/server_name www.example.org/server_name other.example.org/g' other.example.org
5 cat other.example.org
6
7 service nginx restart
8
9 /usr/local/bin/certbot-auto certonly --webroot
10
11
12
13
14
15
16
17 cp /etc/nginx/sites-available/other.example.org.ori /etc/nginx/sites-available/other.example.org
18 cd /etc/letsencrypt/live/other.example.org/
19 cat cert.pem > other_certificate_bundle.crt;
20 echo "" >> other_certificate_bundle.crt;
21 cat chain.pem >> other_certificate_bundle.crt;
22 cp privkey.pem /etc/ssl/private/other_private.key
23 cp other_certificate_bundle.crt /etc/ssl/certs/other_certificate_bundle.crt;
24 service nginx restart
Install on Ubuntu with snap
1 sudo snap install core
2 sudo snap refresh core
3 sudo snap install --classic certbot
4 sudo ln -s /snap/bin/certbot /usr/bin/certbot
5 certbot --nginx
certbot (last edited 2023-10-11 20:46:35 by vitor)