1.EPEL存儲庫添加到CentOS 7系統:
yum install epel-release
2.安裝snapd軟件包
yum install snapd
3.安裝后,需要啟用用於管理主快照通信套接字的systemd單元:
systemctl enable --now snapd.socket
4.在/var/lib/snapd/snap和之間創建符號鏈接/snap
ln -s /var/lib/snapd/snap /snap
5.退出服務器重新登錄服務器
6.第一次安裝報錯,執行第二次沒有報錯這個不知道是什么原因?
第一次:
[root@vmi507538 ~]# snap install core
error: too early for operation, device not yet seeded or device model not acknowledged
第二次:
[root@vmi507538 ~]# snap install core
2021-01-20T12:16:28+01:00 INFO Waiting for automatic snapd restart...
core 16-2.48.2 from Canonical✓ installed
7.
[root@vmi507538 ~]# snap refresh core
snap "core" has no updates available
8.刪除certbot-auto和任何Certbot OS軟件包(如果之前安裝多則執行此步驟)
[root@vmi507538 ~]# yum remove certbot
9.安裝Certbot
在計算機上的命令行上運行此命令以安裝Certbot
[root@vmi507538 evz]# snap install --classic certbot
certbot 1.11.0 from Certbot Project (certbot-eff✓) installed
10.准備Certbot命令
在計算機的命令行上執行以下指令,以確保可以運行certbot命令
[root@vmi507538 evz]# ln -s /snap/bin/certbot /usr/bin/certbot
11.測試獲取證書
[root@vmi507538 evz]# certbot certonly --webroot -w /home/wwwroot/test -d test.abc.com --email test@test.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Account registered.
Requesting a certificate for test.appbundledownload.com
Performing the following challenges:
http-01 challenge for test.appbundledownload.com
Using the webroot path /home/wwwroot/test for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Subscribe to the EFF mailing list (email: operate@everzones.com).
We were unable to subscribe you the EFF mailing list because your e-mail address appears to be invalid. You can try again later by visiting https://act.eff.org.
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/test.appbundledownload.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/test.appbundledownload.com/privkey.pem
Your certificate will expire on 2021-04-20. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again. To non-interactively renew *all* of your
certificates, run "certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
12.證書續期的命令
certbot renew