Let's Encrypt 在Centos 7.6+Nginx环境下申请范解析证书--自动申请与部署更新

admin3年前Linux946

 Let's Encrypt 在Centos 7.6+Nginx环境下申请范解析证书--自动申请与部署更新

安装依赖

yum install -y socat

安装 acme

curl https://get.acme.sh | sh 或者 wget -O - https://get.acme.sh | sh


crontab -l

导入腾讯token

export DP_Id="###"

export DP_Key="####"


申请证书

/root/.acme.sh/acme.sh --issue --dns dns_dp -d example.com -d *.example.com





nginx 部署证书--以后会自动部署


acme.sh --installcert -d example.com  \


--key-file       /etc/letsencrypt/live/www.example.com/privkey.pem \


--fullchain-file /etc/letsencrypt/live/www.example.com/fullchain.pem \


--reloadcmd     "service nginx reload"


或者

acme.sh --installcert -d example.com  --key-file       /etc/letsencrypt/live/www.example.com/privkey.pem --fullchain-file /etc/letsencrypt/live/www.example.com/fullchain.pem --reloadcmd     "service nginx reload"


查看每天任务

crontab -l


手动强制更新证书

acme.sh --renew -d example.com --force


查看证书列表


acme.sh --list


停止 Renew


acme.sh --remove -d example.com

之后手动把目录下的证书移除就行。


参考文档:https://zhuanlan.zhihu.com/p/347064501

                 http://www.manongjc.com/detail/51-avncjkrokejmoty.html

上面两位作者


相关文章

centos7安装新版本python3.10

简单说明Python2.7.5是CentOS 7默认安装的版本;Python3.6.8是CentOS 7中可以通过默认repo安装到的最新版本;如果简单使用,默认的python可能已经够用,但是如果使...

win10 hyper-v 虚拟机ping不通宿主机问题

win10 hyper-v 虚拟机ping不通宿主机问题

在Windows10  Hyper-V 中安装 Linux (Centos6.9)虚拟机无法 ping 通宿主机这种情况下关闭 Windows 防火墙就能ping通了,当然关闭防火墙不安全。...

Nginx设置跨域

Nginx设置跨域

配置代码    add_header Access-Control-Allow-Origin '*';  &nb...

使用pip进行Python包的安装方法以及pip install scrapy

首先,在cmd窗口中,用pip安装Python包,经常会出现超时的现象,主要是由于很多包都是需要从国外的网站上进行下载,所以会限速,但是如果采用国内的镜像进行下载,就会特别快,这里给出几个非常好用的方...

Hyper-v设置centos固定ip的方法

Hyper-v设置centos固定ip的方法

vi /etc/sysconfig/network-scripts/ifcfg-eth0TYPE="Ethernet" PROXY_METHOD="none"...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。