Let’s Encrypt 是一个给网站提供TLS证书的非盈利性证书颁发机构,SSL证书是免费的,而且Google官网推荐使用Let’s Encrypt,官网链接:https://letsencrypt.org/zh-cn/

如何获取免费SSL证书,网站如何设置SSL,http批量更换https

证书获取及安装都是自动的,具体步骤如下:

1)Let’s Encrypt 推荐使用Certbot,打开Certbot官网https://certbot.eff.org/,选择你网站使用的操作系统和服务器系统版本,Certbot会根据你的选择,下方自动列出操作步骤,我用的是Nginx和CentOS,下面依此为例,说明SSL证书安装方法,具体可参见官网 https://certbot.eff.org/lets-encrypt/centosrhel7-nginx

如何获取免费SSL证书,网站如何设置SSL,http批量更换https

2)安装snapd,CentOS需要自己安装snapd,安装方法:https://snapcraft.io/docs/installing-snap-on-centos

如何获取免费SSL证书,网站如何设置SSL,http批量更换https

3)然后安装Certbot,命令 $ sudo snap install –classic certbo

4)运行Certbot,命令$ sudo certbot –nginx

5) 定期自动更新SSL证书,命令$ sudo certbot renew –dry-run

6)配置完成,确认是否可以通过https访问网站。

7)将数据库中的 http://www.cad2d3d.com 替换为 https://www.cad2d3d.com

UPDATE posts SET content=replace(content, ‘http://www.cad2d3d.com’,’https://www.cad2d3d.com’)

下面是我在腾讯云主机 Nginx+CentOS安装过程:

* Socket connection established *

* SSH connection failed: All configured authentication methods failed *
* Connection closed *
* Socket connection established *
Last failed login: Sat Jun 19 10:07:20 CST 2021 from 119.29.96.147 on ssh:notty
There were 82567 failed login attempts since the last successful login.
Last login: Sun Aug 23 19:33:04 2020 from 119.29.96.147
[root@VM_0_3_centos ~]# * Connection closed *
* Socket connection established *
Last failed login: Sat Jun 19 10:18:45 CST 2021 from 49.234.59.246 on ssh:notty
There were 12 failed login attempts since the last successful login.
Last login: Sat Jun 19 10:07:28 2021 from 119.28.22.215
[root@VM_0_3_centos ~]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
[root@VM_0_3_centos ~]# yum install snapd
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
nginx | 2.9 kB 00:00:00
os | 3.6 kB 00:00:00
updates | 2.9 kB 00:00:00
webtatic | 3.6 kB 00:00:00
(1/9): epel/7/x86_64/group_gz | 96 kB 00:00:00
(2/9): epel/7/x86_64/updateinfo | 1.0 MB 00:00:00
(3/9): os/7/x86_64/group_gz | 153 kB 00:00:00
(4/9): extras/7/x86_64/primary_db | 242 kB 00:00:00
(5/9): epel/7/x86_64/primary_db | 6.9 MB 00:00:01
(6/9): os/7/x86_64/primary_db | 6.1 MB 00:00:01
(7/9): nginx/x86_64/primary_db | 211 kB 00:00:01
(8/9): updates/7/x86_64/primary_db | 8.8 MB 00:00:01
(9/9): webtatic/x86_64/primary_db | 271 kB 00:00:01
Determining fastest mirrors
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
–> Running transaction check
—> Package snapd.x86_64 0:2.51-1.el7 will be installed
–> Processing Dependency: snap-confine(x86-64) = 2.51-1.el7 for package: snapd-2.51-1.el7.x86_64
–> Processing Dependency: snapd-selinux = 2.51-1.el7 for package: snapd-2.51-1.el7.x86_64
–> Processing Dependency: fuse for package: snapd-2.51-1.el7.x86_64
–> Processing Dependency: squashfs-tools for package: snapd-2.51-1.el7.x86_64
–> Processing Dependency: squashfuse for package: snapd-2.51-1.el7.x86_64
–> Running transaction check
—> Package fuse.x86_64 0:2.9.2-11.el7 will be installed
—> Package snap-confine.x86_64 0:2.51-1.el7 will be installed
—> Package snapd-selinux.noarch 0:2.51-1.el7 will be installed
–> Processing Dependency: selinux-policy-base >= 3.13.1-268.el7_9.2 for package: snapd-selinux-2.51-1.el7.noarch
–> Processing Dependency: policycoreutils-python for package: snapd-selinux-2.51-1.el7.noarch
—> Package squashfs-tools.x86_64 0:4.3-0.21.gitaae0aff4.el7 will be installed
—> Package squashfuse.x86_64 0:0.1.102-1.el7 will be installed
–> Processing Dependency: squashfuse-libs(x86-64) = 0.1.102-1.el7 for package: squashfuse-0.1.102-1.el7.x86_64
–> Processing Dependency: libfuse.so.2(FUSE_2.4)(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
–> Processing Dependency: libfuse.so.2(FUSE_2.5)(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
–> Processing Dependency: libfuse.so.2(FUSE_2.6)(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
–> Processing Dependency: libfuse.so.2(FUSE_2.8)(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
–> Processing Dependency: libfuse.so.2()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
–> Processing Dependency: libfuseprivate.so.0()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
–> Processing Dependency: liblz4.so.1()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
–> Processing Dependency: libsquashfuse.so.0()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
–> Processing Dependency: libzstd.so.1()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
–> Running transaction check
—> Package fuse-libs.x86_64 0:2.9.2-11.el7 will be installed
—> Package libzstd.x86_64 0:1.5.0-1.el7 will be installed
—> Package lz4.x86_64 0:1.8.3-1.el7 will be installed
—> Package policycoreutils-python.x86_64 0:2.5-34.el7 will be installed
–> Processing Dependency: policycoreutils = 2.5-34.el7 for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: libsemanage-python >= 2.5-14 for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: libcgroup for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
–> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
—> Package selinux-policy-targeted.noarch 0:3.13.1-166.el7 will be updated
—> Package selinux-policy-targeted.noarch 0:3.13.1-268.el7_9.2 will be an update
–> Processing Dependency: selinux-policy = 3.13.1-268.el7_9.2 for package: selinux-policy-targeted-3.13.1-268.el7_9.2.noarch
–> Processing Dependency: selinux-policy = 3.13.1-268.el7_9.2 for package: selinux-policy-targeted-3.13.1-268.el7_9.2.noarch
—> Package squashfuse-libs.x86_64 0:0.1.102-1.el7 will be installed
–> Running transaction check
—> Package audit-libs-python.x86_64 0:2.8.5-4.el7 will be installed
–> Processing Dependency: audit-libs(x86-64) = 2.8.5-4.el7 for package: audit-libs-python-2.8.5-4.el7.x86_64
—> Package checkpolicy.x86_64 0:2.5-8.el7 will be installed
—> Package libcgroup.x86_64 0:0.41-21.el7 will be installed
—> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed
–> Processing Dependency: libsemanage = 2.5-14.el7 for package: libsemanage-python-2.5-14.el7.x86_64
—> Package policycoreutils.x86_64 0:2.5-17.1.el7 will be updated
—> Package policycoreutils.x86_64 0:2.5-34.el7 will be an update
–> Processing Dependency: libsepol >= 2.5-10 for package: policycoreutils-2.5-34.el7.x86_64
–> Processing Dependency: libselinux-utils >= 2.5-14 for package: policycoreutils-2.5-34.el7.x86_64
—> Package python-IPy.noarch 0:0.75-6.el7 will be installed
—> Package selinux-policy.noarch 0:3.13.1-166.el7 will be updated
—> Package selinux-policy.noarch 0:3.13.1-268.el7_9.2 will be an update
—> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed
–> Processing Dependency: libselinux >= 2.5-14.1 for package: setools-libs-3.3.8-4.el7.x86_64
–> Running transaction check
—> Package audit-libs.x86_64 0:2.7.6-3.el7 will be updated
–> Processing Dependency: audit-libs(x86-64) = 2.7.6-3.el7 for package: audit-2.7.6-3.el7.x86_64
—> Package audit-libs.x86_64 0:2.8.5-4.el7 will be an update
—> Package libselinux.x86_64 0:2.5-11.el7 will be updated
–> Processing Dependency: libselinux(x86-64) = 2.5-11.el7 for package: libselinux-python-2.5-11.el7.x86_64
—> Package libselinux.x86_64 0:2.5-15.el7 will be an update
—> Package libselinux-utils.x86_64 0:2.5-11.el7 will be updated
—> Package libselinux-utils.x86_64 0:2.5-15.el7 will be an update
—> Package libsemanage.x86_64 0:2.5-8.el7 will be updated
—> Package libsemanage.x86_64 0:2.5-14.el7 will be an update
—> Package libsepol.x86_64 0:2.5-6.el7 will be updated
—> Package libsepol.x86_64 0:2.5-10.el7 will be an update
–> Running transaction check
—> Package audit.x86_64 0:2.7.6-3.el7 will be updated
—> Package audit.x86_64 0:2.8.5-4.el7 will be an update
—> Package libselinux-python.x86_64 0:2.5-11.el7 will be updated
—> Package libselinux-python.x86_64 0:2.5-15.el7 will be an update
–> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================================================================================
Installing:
snapd x86_64 2.51-1.el7 epel 16 M
Installing for dependencies:
audit-libs-python x86_64 2.8.5-4.el7 os 76 k
checkpolicy x86_64 2.5-8.el7 os 295 k
fuse x86_64 2.9.2-11.el7 os 86 k
fuse-libs x86_64 2.9.2-11.el7 os 93 k
libcgroup x86_64 0.41-21.el7 os 66 k
libsemanage-python x86_64 2.5-14.el7 os 113 k
libzstd x86_64 1.5.0-1.el7 epel 370 k
lz4 x86_64 1.8.3-1.el7 os 85 k
policycoreutils-python x86_64 2.5-34.el7 os 457 k
python-IPy noarch 0.75-6.el7 os 32 k
setools-libs x86_64 3.3.8-4.el7 os 620 k
snap-confine x86_64 2.51-1.el7 epel 2.9 M
snapd-selinux noarch 2.51-1.el7 epel 421 k
squashfs-tools x86_64 4.3-0.21.gitaae0aff4.el7 os 101 k
squashfuse x86_64 0.1.102-1.el7 epel 18 k
squashfuse-libs x86_64 0.1.102-1.el7 epel 24 k
Updating for dependencies:
audit x86_64 2.8.5-4.el7 os 256 k
audit-libs x86_64 2.8.5-4.el7 os 102 k
libselinux x86_64 2.5-15.el7 os 162 k
libselinux-python x86_64 2.5-15.el7 os 236 k
libselinux-utils x86_64 2.5-15.el7 os 151 k
libsemanage x86_64 2.5-14.el7 os 151 k
libsepol x86_64 2.5-10.el7 os 297 k
policycoreutils x86_64 2.5-34.el7 os 917 k
selinux-policy noarch 3.13.1-268.el7_9.2 updates 498 k
selinux-policy-targeted noarch 3.13.1-268.el7_9.2 updates 7.0 M

Transaction Summary
==================================================================================================================================================================================================================
Install 1 Package (+16 Dependent packages)
Upgrade ( 10 Dependent packages)

Total download size: 31 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/27): audit-libs-2.8.5-4.el7.x86_64.rpm | 102 kB 00:00:00
(2/27): audit-2.8.5-4.el7.x86_64.rpm | 256 kB 00:00:00
(3/27): audit-libs-python-2.8.5-4.el7.x86_64.rpm | 76 kB 00:00:00
(4/27): checkpolicy-2.5-8.el7.x86_64.rpm | 295 kB 00:00:00
(5/27): fuse-2.9.2-11.el7.x86_64.rpm | 86 kB 00:00:00
(6/27): fuse-libs-2.9.2-11.el7.x86_64.rpm | 93 kB 00:00:00
(7/27): libcgroup-0.41-21.el7.x86_64.rpm | 66 kB 00:00:00
(8/27): libselinux-2.5-15.el7.x86_64.rpm | 162 kB 00:00:00
(9/27): libselinux-python-2.5-15.el7.x86_64.rpm | 236 kB 00:00:00
(10/27): libselinux-utils-2.5-15.el7.x86_64.rpm | 151 kB 00:00:00
(11/27): libsemanage-2.5-14.el7.x86_64.rpm | 151 kB 00:00:00
(12/27): libsemanage-python-2.5-14.el7.x86_64.rpm | 113 kB 00:00:00
(13/27): lz4-1.8.3-1.el7.x86_64.rpm | 85 kB 00:00:00
(14/27): libsepol-2.5-10.el7.x86_64.rpm | 297 kB 00:00:00
(15/27): libzstd-1.5.0-1.el7.x86_64.rpm | 370 kB 00:00:00
(16/27): policycoreutils-python-2.5-34.el7.x86_64.rpm | 457 kB 00:00:00
(17/27): policycoreutils-2.5-34.el7.x86_64.rpm | 917 kB 00:00:00
(18/27): python-IPy-0.75-6.el7.noarch.rpm | 32 kB 00:00:00
(19/27): setools-libs-3.3.8-4.el7.x86_64.rpm | 620 kB 00:00:00
(20/27): selinux-policy-3.13.1-268.el7_9.2.noarch.rpm | 498 kB 00:00:00
(21/27): snap-confine-2.51-1.el7.x86_64.rpm | 2.9 MB 00:00:00
(22/27): squashfs-tools-4.3-0.21.gitaae0aff4.el7.x86_64.rpm | 101 kB 00:00:00
(23/27): selinux-policy-targeted-3.13.1-268.el7_9.2.noarch.rpm | 7.0 MB 00:00:01
(24/27): snapd-selinux-2.51-1.el7.noarch.rpm | 421 kB 00:00:00
(25/27): squashfuse-0.1.102-1.el7.x86_64.rpm | 18 kB 00:00:00
(26/27): squashfuse-libs-0.1.102-1.el7.x86_64.rpm | 24 kB 00:00:00
(27/27): snapd-2.51-1.el7.x86_64.rpm | 16 MB 00:00:01
——————————————————————————————————————————————————————————————————————
Total 6.9 MB/s | 31 MB 00:00:04
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Updating : libsepol-2.5-10.el7.x86_64 1/37
Updating : libselinux-2.5-15.el7.x86_64 2/37
Updating : audit-libs-2.8.5-4.el7.x86_64 3/37
Updating : libsemanage-2.5-14.el7.x86_64 4/37
Updating : libselinux-utils-2.5-15.el7.x86_64 5/37
Updating : policycoreutils-2.5-34.el7.x86_64 6/37
Updating : selinux-policy-3.13.1-268.el7_9.2.noarch 7/37
Updating : selinux-policy-targeted-3.13.1-268.el7_9.2.noarch 8/37
Installing : libsemanage-python-2.5-14.el7.x86_64 9/37
Installing : audit-libs-python-2.8.5-4.el7.x86_64 10/37
Installing : snap-confine-2.51-1.el7.x86_64 11/37
Installing : setools-libs-3.3.8-4.el7.x86_64 12/37
Updating : libselinux-python-2.5-15.el7.x86_64 13/37
Installing : libcgroup-0.41-21.el7.x86_64 14/37
Installing : libzstd-1.5.0-1.el7.x86_64 15/37
Installing : python-IPy-0.75-6.el7.noarch 16/37
Installing : checkpolicy-2.5-8.el7.x86_64 17/37
Installing : policycoreutils-python-2.5-34.el7.x86_64 18/37
Installing : snapd-selinux-2.51-1.el7.noarch 19/37
Installing : squashfs-tools-4.3-0.21.gitaae0aff4.el7.x86_64 20/37
Installing : fuse-2.9.2-11.el7.x86_64 21/37
Installing : fuse-libs-2.9.2-11.el7.x86_64 22/37
Installing : lz4-1.8.3-1.el7.x86_64 23/37
Installing : squashfuse-libs-0.1.102-1.el7.x86_64 24/37
Installing : squashfuse-0.1.102-1.el7.x86_64 25/37
Installing : snapd-2.51-1.el7.x86_64 26/37
Updating : audit-2.8.5-4.el7.x86_64 27/37
Cleanup : selinux-policy-targeted-3.13.1-166.el7.noarch 28/37
Cleanup : selinux-policy-3.13.1-166.el7.noarch 29/37
Cleanup : policycoreutils-2.5-17.1.el7.x86_64 30/37
Cleanup : libsemanage-2.5-8.el7.x86_64 31/37
Cleanup : libselinux-utils-2.5-11.el7.x86_64 32/37
Cleanup : libselinux-python-2.5-11.el7.x86_64 33/37
Cleanup : libselinux-2.5-11.el7.x86_64 34/37
Cleanup : audit-2.7.6-3.el7.x86_64 35/37
Cleanup : audit-libs-2.7.6-3.el7.x86_64 36/37
Cleanup : libsepol-2.5-6.el7.x86_64 37/37
Verifying : squashfuse-libs-0.1.102-1.el7.x86_64 1/37
Verifying : lz4-1.8.3-1.el7.x86_64 2/37
Verifying : fuse-libs-2.9.2-11.el7.x86_64 3/37
Verifying : fuse-2.9.2-11.el7.x86_64 4/37
Verifying : squashfs-tools-4.3-0.21.gitaae0aff4.el7.x86_64 5/37
Verifying : libselinux-2.5-15.el7.x86_64 6/37
Verifying : snapd-2.51-1.el7.x86_64 7/37
Verifying : snapd-selinux-2.51-1.el7.noarch 8/37
Verifying : selinux-policy-targeted-3.13.1-268.el7_9.2.noarch 9/37
Verifying : audit-libs-python-2.8.5-4.el7.x86_64 10/37
Verifying : audit-libs-2.8.5-4.el7.x86_64 11/37
Verifying : checkpolicy-2.5-8.el7.x86_64 12/37
Verifying : policycoreutils-2.5-34.el7.x86_64 13/37
Verifying : snap-confine-2.51-1.el7.x86_64 14/37
Verifying : python-IPy-0.75-6.el7.noarch 15/37
Verifying : libselinux-utils-2.5-15.el7.x86_64 16/37
Verifying : policycoreutils-python-2.5-34.el7.x86_64 17/37
Verifying : setools-libs-3.3.8-4.el7.x86_64 18/37
Verifying : libsemanage-python-2.5-14.el7.x86_64 19/37
Verifying : audit-2.8.5-4.el7.x86_64 20/37
Verifying : libzstd-1.5.0-1.el7.x86_64 21/37
Verifying : libsemanage-2.5-14.el7.x86_64 22/37
Verifying : libselinux-python-2.5-15.el7.x86_64 23/37
Verifying : libsepol-2.5-10.el7.x86_64 24/37
Verifying : selinux-policy-3.13.1-268.el7_9.2.noarch 25/37
Verifying : squashfuse-0.1.102-1.el7.x86_64 26/37
Verifying : libcgroup-0.41-21.el7.x86_64 27/37
Verifying : libsepol-2.5-6.el7.x86_64 28/37
Verifying : libselinux-utils-2.5-11.el7.x86_64 29/37
Verifying : selinux-policy-3.13.1-166.el7.noarch 30/37
Verifying : audit-libs-2.7.6-3.el7.x86_64 31/37
Verifying : audit-2.7.6-3.el7.x86_64 32/37
Verifying : policycoreutils-2.5-17.1.el7.x86_64 33/37
Verifying : libsemanage-2.5-8.el7.x86_64 34/37
Verifying : libselinux-2.5-11.el7.x86_64 35/37
Verifying : libselinux-python-2.5-11.el7.x86_64 36/37
Verifying : selinux-policy-targeted-3.13.1-166.el7.noarch 37/37

Installed:
snapd.x86_64 0:2.51-1.el7

Dependency Installed:
audit-libs-python.x86_64 0:2.8.5-4.el7 checkpolicy.x86_64 0:2.5-8.el7 fuse.x86_64 0:2.9.2-11.el7 fuse-libs.x86_64 0:2.9.2-11.el7 libcgroup.x86_64 0:0.41-21.el7
libsemanage-python.x86_64 0:2.5-14.el7 libzstd.x86_64 0:1.5.0-1.el7 lz4.x86_64 0:1.8.3-1.el7 policycoreutils-python.x86_64 0:2.5-34.el7 python-IPy.noarch 0:0.75-6.el7
setools-libs.x86_64 0:3.3.8-4.el7 snap-confine.x86_64 0:2.51-1.el7 snapd-selinux.noarch 0:2.51-1.el7 squashfs-tools.x86_64 0:4.3-0.21.gitaae0aff4.el7 squashfuse.x86_64 0:0.1.102-1.el7
squashfuse-libs.x86_64 0:0.1.102-1.el7

Dependency Updated:
audit.x86_64 0:2.8.5-4.el7 audit-libs.x86_64 0:2.8.5-4.el7 libselinux.x86_64 0:2.5-15.el7 libselinux-python.x86_64 0:2.5-15.el7 libselinux-utils.x86_64 0:2.5-15.el7
libsemanage.x86_64 0:2.5-14.el7 libsepol.x86_64 0:2.5-10.el7 policycoreutils.x86_64 0:2.5-34.el7 selinux-policy.noarch 0:3.13.1-268.el7_9.2 selinux-policy-targeted.noarch 0:3.13.1-268.el7_9.2

Complete!
[root@VM_0_3_centos ~]# systemctl enable –now snapd.socket
Created symlink from /etc/systemd/system/sockets.target.wants/snapd.socket to /usr/lib/systemd/system/snapd.socket.
[root@VM_0_3_centos ~]# ln -s /var/lib/snapd/snap /snap
[root@VM_0_3_centos ~]# snap install core
Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you’ve not restarted your session
since you installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469
for more details.

core 16-2.51 from Canonical✓ installed
[root@VM_0_3_centos ~]# snap refresh core
snap “core” has no updates available
[root@VM_0_3_centos ~]# apt-get remove certbot
-bash: apt-get: command not found
[root@VM_0_3_centos ~]# yum remove certbot
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
No Match for argument: certbot
No Packages marked for removal
[root@VM_0_3_centos ~]# snap install –classic certbot
Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you’ve not restarted your session
since you installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469
for more details.

certbot 1.16.0 from Certbot Project (certbot-eff✓) installed
[root@VM_0_3_centos ~]# ln -s /snap/bin/certbot /usr/bin/certbot
[root@VM_0_3_centos ~]# certbot –nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
(Enter ‘c’ to cancel): 1968469820@@qq.com
Invalid email address: 1968469820@@qq.com.
There seem to be problems with that address.

If you really want to skip this, you can run the client with
–register-unsafely-without-email but you will then be unable to receive notice
about impending expiration or revocation of your certificates or problems with
your Certbot installation that will lead to failure to renew.

Enter email address (used for urgent renewal and security notices)
(Enter ‘c’ to cancel): 1968469820@qq.com

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
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.

Which names would you like to activate HTTPS for?
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
1: cad2d3d.com
2: www.cad2d3d.com
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter ‘c’ to cancel): 2
Requesting a certificate for www.cad2d3d.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/www.cad2d3d.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/www.cad2d3d.com/privkey.pem
This certificate expires on 2021-09-17.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for www.cad2d3d.com to /etc/nginx/nginx.conf
Congratulations! You have successfully enabled HTTPS on https://www.cad2d3d.com

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
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
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
[root@VM_0_3_centos ~]# certbot renew –dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Processing /etc/letsencrypt/renewal/www.cad2d3d.com.conf
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Account registered.
Simulating renewal of an existing certificate for www.cad2d3d.com

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Congratulations, all simulated renewals succeeded:
/etc/letsencrypt/live/www.cad2d3d.com/fullchain.pem (success)
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

Post Comment

Your email address will not be published. Required fields are marked *