[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

Webuzo: Free VPS Panel (CentOS Only)

CentOS only. Support PHP, Apache, HGIGX, and Mysq...

PupaVPS: $10/year/128MB RAM/7GB storage/500GB bandwidth/OpenVZ

PupaVPS should be founded by Chinese people, with...

FrapHost: $25/year/1GB memory/15GB space/500G traffic/OpenVZ

Introduction FrapHost is a hosting company founde...

Vultr 512MB RAM KVM VPS Japan Review

Details: Vultr: $2.5/month/512MB memory/20GB SSD ...

Netcetera: £28.99/month/Xeon X3350/4GB memory/1TB space/unlimited traffic/UK

Netcetera, a British hosting provider, was founde...

Free Let's Encrypt cPanel plugin

The free SSL provided by Let's Encrypt is gre...

One-click script to install pure Debian/Ubuntu version under Linux network

If you need a pure CentOS system, please see: One...

VPSCreed: $7.5/month/6 cores/2GB memory/60GB SSD/3TB bandwidth/KVM

VPSCreed, a recently launched managed VPS, is off...