『贴Builder』
最新文章
热门话题
用户问答
lao人言
「搜索」
PasteSpider
一款更加适合开发人员的微服务(容器)发布管理工具

节省资源

极小的运行资源消耗,还支持一拖多运行,运行内存甚至低至100MB!

安全运行

和业务服务没有层级上的关联,哪怕PasteSpider停止运行也不会影响你的业务服务运行

简单易上手

一键安装,图形操作点点点即可完成操作,附属服务的支持原汁原味,简单易上手

环境隔离

支持拆分多环境运行,工厂,测试两不误,还可以根据环境配置适应不一样的配置信息

适用功能一应俱全

从项目角度进行服务容器管理,支持自动升级,扩容,缩减,状态报表,键值配置,自动路由等

支持Git/Svn代码管理

通过配置支持服务环境级别的自动提交构建,一键提交代码后即可自动发布服务和路由等

免费SSL证书,自动续期配置,配合PasteSpider的路由策略,用得飞起
尘埃 2023-02-05 1686 85 0
在centos7中配置免费的SSL,可以自动续期

https://letsencrypt.org/

很火得一个免费证书获取渠道,接下来我们看下如何在linux上配置,让ssl证书自动续期

我们使用 https://certbot.eff.org/ 模式

比如我使用centos7,运行在Nginx上,如下选择

image.png

如果你是其他系统得,反正就是按照这个提示去选择,他会有教程告诉你接下来如何操作!

比如我上面选择的环境

SSH into the server

使用SSH连接到服务器

SSH into the server running your HTTP website as a user with sudo privileges.

以具有sudo权限的用户身份将SSH连接到运行HTTP网站的服务器,或者root账号也行

Install snapd

安装snapd

You'll need to install snapd and make sure you follow any instructions to enable classic snap support.

您需要安装snapd,并确保按照任何说明启用经典的snap支持。

Follow these instructions on snapcraft's site to install snapd.

按照snapcraft网站上的说明安装snapd。

如何检测当前服务器是否安装了snapd?直接输入命令

snap --version

看看提示啥,如果提示 snap command not found!那就是没有安装,需要参照一下教程安装

打开snap安装的官网

https://snapcraft.io/docs/installing-snapd

在中间位置表格处找到Centos,然后往下拉,可以看到如下提示

image.png

Ensure that your version of snapd is up to date

确保snapd的版本是最新的

Execute the following instructions on the command line on the machine to ensure that you have the latest version of snapd.

在计算机的命令行上执行以下指令,以确保您拥有最新版本的snapd。

sudo snap install core; sudo snap refresh core

Remove certbot-auto and any Certbot OS packages

删除certbot auto和任何certbot OS包

If you have any Certbot packages installed using an OS package manager like apt, dnf, or yum, you should remove them before installing the Certbot snap to ensure that when you run the command certbot the snap is used rather than the installation from your OS package manager. The exact command to do this depends on your OS, but common examples are sudo apt-get remove certbot, sudo dnf remove certbot, or sudo yum remove certbot.

如果使用apt、dnf或yum等操作系统软件包管理器安装了任何Certbot软件包,则应在安装Certbot snap之前将其删除,以确保在运行命令Certbot时使用snap,而不是从操作系统软件管理器安装。执行此操作的确切命令取决于您的操作系统,但常见的示例有sudo apt-get remove certbot、sudo dnf remove certbot或sudo yum remove certbot。

Install Certbot

安装Certbot

Run this command on the command line on the machine to install Certbot

在计算机上的命令行上运行此命令以安装Certbot

sudo snap install --classic certbot

Prepare the Certbot command

准备Certbot命令

Execute the following instruction on the command line on the machine to ensure that the certbot command can be run.

在计算机的命令行上执行以下指令,以确保可以运行certbot命令。

sudo ln -s /snap/bin/certbot /usr/bin/certbot

Choose how you'd like to run Certbot

选择运行Certbot的方式

Either get and install your certificates...

获取并安装证书。。。

Run this command to get a certificate and have Certbot edit your nginx configuration automatically to serve it, turning on HTTPS access in a single step.

运行此命令以获取证书,并让Certbot自动编辑nginx配置以提供证书,只需一步即可打开HTTPS访问。

sudo certbot --nginx

Or, just get a certificate

或者,只要拿到证书

If you're feeling more conservative and would like to make the changes to your nginx configuration by hand, run this command.

如果您感觉更保守,并且希望手动更改nginx配置,请运行此命令。

sudo certbot certonly --nginx

Test automatic renewal

测试自动续订

The Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire. You will not need to run Certbot again, unless you change your configuration. You can test automatic renewal for your certificates by running this command:

系统上的Certbot软件包附带一个cron作业或systemd计时器,该计时器将在证书过期之前自动续订您的证书。除非更改配置,否则不需要再次运行Certbot。您可以通过运行以下命令测试证书的自动续订:

sudo certbot renew --dry-run

The command to renew certbot is installed in one of the following locations:

续订certbot的命令安装在以下位置之一:

  • /etc/crontab/
  • /etc/cron.*/*
  • systemctl list-timers

Confirm that Certbot worked

确认Certbot工作正常

To confirm that your site is set up properly, visit https://yourwebsite.com/ in your browser and look for the lock icon in the URL bar.

要确认您的网站设置正确,请访问https://yourwebsite.com/在浏览器中,并在URL栏中查找锁定图标。


我们有计划在后续的PasteSpider版本中引入一键安装这个ssl证书!



评论列表
尘埃
85 1686 0
快捷注册
最新动态
  • 219.****.130 正在查看 在Docker中安装postgresql数据库! !
  • 225.****.176 正在查看 使用PasteSpider实现CI/CD持续部署,类似Jenkins的功能,让你的2G服务器也可以飞起 !
  • 30.****.89 正在查看 Redis的安装 !
  • 120.****.172 正在查看 CRUD的最佳实践,联动前后端,包含微信小程序,API,HTML等(二) !
  • 135.****.115 正在查看 最佳CRUD实践之联动管理端,API和小程序之实际案例改造分享(四) !
  • 191.****.155 正在查看 PasteSpider升级服务器上的一个服务或集群服务 !
  • 128.****.164 正在查看 PasteSpider之项目-服务-环境介绍 !
  • 86.****.11 正在查看 在centos7中安装docker !
  • 189.****.120 正在查看 免费SSL证书,自动续期配置,配合PasteSpider的路由策略,用得飞起 !
  • 198.****.232 正在查看 PasteSpider之项目-服务-环境介绍 !
  • 18.****.134 正在查看 在centos7中安装docker !
欢迎加入QQ讨论群 296245685 更新记录 [PasteSpider]介绍 @2022-2023 PasteCode.cn 版权所有 ICP证 闽ICP备2021013869号-2