最新版 Let’s Encrypt免费证书申请步骤,保姆级教程

这篇具有很好参考价值的文章主要介绍了最新版 Let’s Encrypt免费证书申请步骤,保姆级教程。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

最近将域名迁到了google domain,就研究了一下Let’s Encrypt的域名证书配置。发现网上找到的教程在官方说明中已经废弃,所以自己写一个流程记录一下。

步骤方法官方文档见:https://eff-certbot.readthedocs.io/en/stable/install.html#installation

snapd官方文档见:https://certbot.eff.org/instructions

1. 安装snapd
  • centos(这里我使用的是这个系统)
    sudo yum install snapd
    sudo systemctl enable --now snapd.socket
    sudo ln -s /var/lib/snapd/snap /snap
    

  • ubuntu的
    $ sudo apt update
    $ sudo apt install snapd
    

测试一下:

$ sudo snap install hello-world
hello-world 6.4 from Canonical✓ installed
$ hello-world
Hello World!
2. 使用snapd安装certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
3. 生成证书(需要指定nginx)

👉 手动安装nginx

certbot certonly --nginx --nginx-ctl /usr/local/nginx/sbin/nginx --nginx-server-root /usr/local/nginx/conf

这里的certonly就是只下载对应文件,不进行配置nginx,适用于自己配置或者更新使用。去掉则会帮你进行配置nginx(我没有试用)。

可能出现的问题:

The error was: PluginError(‘Nginx build is missing SSL module (–with-http_ssl_module).’)

提示这个错误是因为目前nginx缺少–with-http_ssl_module这个模块,我们要添加这个模块。重新编译nginx

进入nginx下载的目录

./configure --prefix=/usr/local/nginx --with-http_ssl_module

编译完成后

make

make install

/usr/local/nginx/sbin/nginx -s stop

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

使用 /usr/local/nginx/sbin/nginx -V 查看是否生效

[root]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.23.2
built by gcc 10.2.1 20200825 (Alibaba 10.2.1-3 2.32) (GCC) 
built with OpenSSL 1.1.1k  FIPS 25 Mar 2021
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module

生效,重新执行上面的命令即可。

4. 生成证书

执行上面的命令后,程序会让你确认你的邮箱和你的域名,确认完成后会将证书文件生成在指定目录中。

certbot certonly --nginx --nginx-ctl /usr/local/nginx/sbin/nginx --nginx-server-root /usr/local/nginx/conf
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): [这里输入你的邮箱]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.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 [选Y 继续]
Account registered.

Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: whrss.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):  [这里不需要输入,回车选所有]
Requesting a certificate for whrss.com

Successfully received certificate.
Certificate is saved at: 
# [这里告诉我们生成的文件路径和有效期]
/etc/letsencrypt/live/whrss.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/whrss.com/privkey.pem
This certificate expires on 2023-03-02.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

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

5. Nginx.conf的配置
server{
        #监听443端口
        listen 443 ssl;
        #对应的域名,空格分隔域名就可以了
        server_name whrss.com; 
        #第一个域名的文件
        ssl_certificate /etc/letsencrypt/live/whrss.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/whrss.com/privkey.pem;
        # 其他配置
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
        ssl_prefer_server_ciphers on;
        #这是我的主页访问地址,因为使用的是静态的html网页,所以直接使用location就可以完成了。
        location / {
            root   /;
            index  /;
            proxy_pass http://127.0.0.1:9091;
            proxy_set_header Host $host:443;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Via "nginx";
        }
}

以上!!文章来源地址https://www.toymoban.com/news/detail-469195.html

到了这里,关于最新版 Let’s Encrypt免费证书申请步骤,保姆级教程的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Let’s Encrypt免费证书获取方法

    域名所有者:Let’s Encrypt 是一个证书颁发机构(CA), 要从 Let’s Encrypt 获取网站域名的证书,必须证明对域名的实际控制权。 ACME 协议软件 : 在Let’s Encrypt 使用 ACME 协议来验证对给定域名的控制权并颁发证书, 要从Let’s Encrypt 获得证书,需要选择一个要使用的 ACME 客户端 Certbot 、

    2024年02月05日
    浏览(31)
  • SSL证书系列--又拍云Let’s Encrypt免费DV SSL证书使用教程

    原文网址:SSL证书系列--又拍云Let’s Encrypt免费DV SSL证书使用教程_IT利刃出鞘的博客-CSDN博客 本文介绍如何使用又拍云部署Let’s Encrypt免费DV SSL证书。 了解和关注SSL证书的朋友,似乎没有理由不知道 Let’s Encrypt 这个免费、自动化、开放的证书签发服务。         它由 I

    2024年02月09日
    浏览(34)
  • 宝塔面板站点SSL,Let‘s Encrypt 证书申请报错:Invalid version. The only valid version for X509Req is 0.

    Linux正式版 7.9.10 CentOS 7.3.1611 x86_64(Py3.7.9) 新服务器 , 新装宝塔 , 新增站点 ,ssl选择Let’s Encrypt,点击申请证书 报错: 文件验证和DNS验证都报这个错。 试过修复面板(无效),试过回退到7.9.8版本(无效) 您好,您这个报错是因为面板依赖的不兼容导致的证书申请失败,

    2024年02月09日
    浏览(33)
  • 最新版Typora免费使用教程心得

    Typora是一个功能强大的文本编辑器,它的主要特点是它使用Markdown语言进行编辑和排版。与其他文本编辑器不同的是,Typora的编辑界面具有非常简洁和直观的设计,使得编辑和排版变得更加容易。 在本文中,我们将深入了解Typora的各个方面,并详细介绍它的各种功能和优点。

    2024年02月13日
    浏览(37)
  • 免费的chatgpt网站(包含最新版4.0)

            第一个就给大家介绍一个狠角色,最新版本免费4.0,正如我下面贴图显示,它可以随时满足你的图像创作需求,开动你的脑筋,不管是钢铁侠大战孙悟空还是火柴人大战金刚狼,它都可以轻松实现。         当然,作为目前最顶尖的chat gpt版本,它的功能远不

    2024年04月16日
    浏览(43)
  • 最新版Emlog采集发布插件-免费下载

    推荐一款可以自动采集网页文章数据,并发布到Emlog网站的Emlog采集发布插件(兼容最新的Emlog Pro版本,也兼容之前的 Emlog 5.3 和 Emlog 6.0 版本),支持对接简数采集器,火车头采集器,八爪鱼采集器,后羿采集器等大多数网页采集软件。 最新版Emlog采集发布插件使用方法如下

    2024年02月19日
    浏览(47)
  • Parallels Desktop2023最新版免费虚拟机软件

    很多朋友用上了MacBook,但很多软件只能在Windows系统来使用,小白想要在MacBook上装Windows,需要花费大量的时间,所以在此,教大家在MacBook上安装虚拟机,来运行Windows系统。对MacOS用户来说,在遍地充斥着Windows操作系统的世界中工作和娱乐是个并不简单的事情,拿笔者本人来

    2024年02月04日
    浏览(43)
  • Docker获取Let`s Encrypt SSL 证书

    文中的操作都是在CentOS Stream release 9下执行的,使用的是root用户。 关于Let`s Encrypt可以参见这里。 certbot安装使用参加这里。 为了方便维护、升级,同时也避免破坏本地的开发环境,我这里使用docker方式来运行certbot。整个过程分为两步:首次申请证书和证书更新。 因为我的文

    2024年02月01日
    浏览(28)
  • 不用订阅,不用破解,永久免费使用Axure最新版教程

    首先去官网下载最新的axure,你没听错,就是最新的。 下载网址:Axure RP - UX Prototypes, Specifications, and Diagrams in One Tool 下载完后解压安装到本地,并注册属于你自己的账户,开始试用。可惜的是只有30天的试用日期。 本次永久使用axure的方法就是修改axure的启动时间,以达到永

    2024年02月10日
    浏览(30)
  • 2023 最新版navicat 下载与安装 步骤及演示 (图示版)

    博主 默语带您 Go to New World. ✍ 个人主页—— 默语 的博客👦🏻 《java 面试题大全》 🍩惟余辈才疏学浅,临摹之作或有不妥之处,还请读者海涵指正。☕🍭 《MYSQL从入门到精通》数据库是开发者必会基础之一~ 🪁 吾期望此文有资助于尔,即使粗浅难及深广,亦备添少许微薄

    2024年02月13日
    浏览(54)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包