Install SSL certificate

I wanted to install Let’s Encrypt ssl certificate on my Centos 7 Aliyun server. After encountering so many errors, using the method on Centos 6, I finally installed it.

 wget https://dl.eff.org/certbot-auto
chmod a+x ./certbot-auto
./certbot-auto

Then, set up auto-renew.

 sudo vi /usr/lib/systemd/system/certbot.service   
[Unit]
Description=Lets Encrypt renewal
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --quiet --agree-tos

sudo vi /usr/lib/systemd/system/certbot.timer
[Unit]
Description=Twice daily renewal of Lets Encrypts certificates
[Timer]
OnCalendar=0/12:00:00
RandomizedDelaySec=1h
Persistent=true
[Install]
WantedBy=timers.target
sudo systemctl enable certbot.timer
sudo systemctl start certbot.timer

References:
https://certbot.eff.org/lets-encrypt/centos6-apache
https://certbot.eff.org/lets-encrypt/centosrhel7-apache
https://www.yuzhi100.com/article/centos-7-install-lets-encrypt-certbot


Leave a Reply

Your email address will not be published. Required fields are marked *