[Free SSL] Quickly obtain/renew Let's encrypt certificate

[Free SSL] Quickly obtain/renew Let's encrypt certificate

Let's encrypt's free SSL certificate can be used directly. The following is a quick acquisition script for v2ex. The host encyclopedia has been successfully used.
Call acme_tiny.py to authenticate, obtain, and update certificates without requiring additional dependencies.

1. Download the file

 wget https://raw.githubusercontent.com/xdtianyu/scripts/master/lets-encrypt/letsencrypt.conf wget https://raw.githubusercontent.com/xdtianyu/scripts/master/lets-encrypt/letsencrypt.sh

2. Modify the letsencrypt.conf file
ACCOUNT_KEY="letsencrypt-account.key"
DOMAIN_KEY="example.com.key"
DOMAIN_DIR="/var/www/example.com"
DOMAINS="DNS:example.com,DNS:whatever.example.com"

Replace example.com with your own domain name, such as zhujiwiki.com
Change /var/www/example.com to your own website directory

 ACCOUNT_KEY="letsencrypt-account.key" DOMAIN_KEY="zhujiwiki.key" DOMAIN_DIR="/home/wwwroot/web/zhujiwiki.com" DOMAINS="DNS:zhujiwiki.com,DNS:www.zhujiwiki.com"

3. Modify line 32 of the openssl.cnf location file in letsencrypt.sh: /etc/ssl/openssl.cnf
CentOS directory: /etc/pki/tls/openssl.cnf
Debian: No need to change

4. Execute under SSH:

 yum install python-argparse chmod +x letsencrypt.sh ./letsencrypt.sh letsencrypt.conf

If it appears
Traceback (most recent call last):
File "/tmp/acme_tiny.py", line 2, in
import argparse, subprocess, json, os, sys, base64, binascii, time, hashlib, re, copy, textwrap, logging
ImportError: No module named argparse

Execute the command:

 yum install python-argparse

5. Configuration and use
The ssl file is stored in the current directory

6. Because the Let's encrypt certificate will expire in 90 days, you can execute scheduled tasks.

 crontab -e

Add the following:

 0 0 1 * * /root/letsencrypt.sh /root/letsencrypt.conf >> /var/log/lets-encrypt.log 2>&1

😡 Save and exit.

vi:v2ex

<<:  AMH4.2 PHP automatic upgrade to 5.4/5.5/5.6 script

>>:  SingleHop: $199/month/128GB memory/4TB hard drive/10TB traffic/5 IP/Phoenix

Recommend

How to use Adsense channel tracking to maximize revenue

In the previous chapter, we discussed the issue o...

clouvider i3-3240 4GB memory 1Gbps bandwidth UK independent server review

Details: clouvider: UK exclusive server, minimum ...

Onetsolutions French VPS purchase, registration, payment graphic tutorial

Details : onetsolutions: €0.99/month/2GB memory/1...

CenterHop: $2.5/month/768MB memory/15GB SSD space/1TB traffic/KVM/Singapore

CenterHop, a formally registered company (Reg No....

Insert ads in articles (for WordPress)

Generally speaking, we place Google Adsense ads b...

Tulin Cloud: $6/month/1GB RAM/20GB SSD space/unlimited traffic/KVM/Los Angeles

Tulin Cloud, a Chinese merchant, is newly establi...