Skip to content

SSL Certificates with Certbot

利用Certbot自动申请Let's Encrypt自签名SSL证书

1. Requirements

  • 一个有公网IPv4/IPv6的VPS
  • 一个解析到VPS IP地址的子域名

2. Install Certbot

CentOS/RHEL:

sudo yum install -y certbot.noarch
Ubuntu/Debian:
sudo apt-get install -y certbot

3. Using Certbot

(1). 停止所有的WEB服务

在Certbot申请证书过程中,会用到VPS的80和443端口,当有程序占用该端口时,程序会报错。

(2). Applying for SSL Certifications

certbot certonly --standalone --email EMAIL_ADDRESS@example.com -d TEXT.example.com
在交互确认界面确认验证信息。

完成申请后会显示证书存放的地址,一般为 /etc/letsencrypt/live/example.com/privkey.pem