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