名驗證。當驗證通過后,Certbot 會將證書文件存放在 `/etc/letsencrypt/live/example.com/` 目錄下。
3. 配置 Web 服務器
證書申請成功后,需要將證書配置到 Web 服務器上,以便服務器能夠使用該證書進行加密通信。
以 Apache 服務器為例,需要將以下配置添加到 Apache 的配置文件中:
“`
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
“`
其中,`SSLEngine on` 表示啟用 SSL,`SSLCertificateFile`、`SSLCertificateKeyFile`、`SSLCertificateChainFile` 分別指定 SSL 證書、私鑰和證書鏈的路徑。
4. 證書續期
Let’s Encrypt 提供的 SSL 證書有效期只有 90 天,因此需要定期對證書進行續期。Certbot 工具提供了自動續期功能,可以通過設置計劃任務來定期執行證書續期命令。
以上就是免費 SSL 證書的申請原理及詳細過程。需要注意的是,由于免費 SSL 證書的申請和驗證過程較為復雜,所以建議有一定技術基礎的用戶進行操作。