letsencrypt 免费证书申请

获取脚本nginx

git clone https://github.com/letsencrypt/letsencrypt

cd ./letsencrypt

 

获取证书git

#获取证书以前,知足github

一、80端口没有占用web

二、你申请的域名已经指向了本机服务器IPapache


 

letsencrypt-auto certonly --standalone --email lihongkai1001@gamil.com -d gs-yb.haohaogamez.com

#后面会输出证书存放路径服务器

 

证书有效期默认90天 定时更新证书有效期 每个月1号 凌晨 3点执行一次网站

0 0 3 * * sh /opt/letsencrypt/letsencrypt-auto-renew.sh



#/bin/sh

openresty -s stop #中止nginx

/opt/letsencrypt/letsencrypt-auto renew --force-renew #更新证书有效期

openresty #运行nginx

 

命令说明插件

run:获取并安装证书到当前的Web服务器rest

certonly:获取或续期证书,可是不安装code

renew:在证书快过时时,续期以前获取的全部证书

-d DOMAINS:一个证书支持多个域名,用逗号分隔

 

--apache:使用 Apache 插件来认证和安装证书

--standalone:运行独立的 web server 来验证

--nginx:使用 Nginx 插件来认证和安装证书

--webroot:若是目标服务器已经有 web server 运行且不能关闭,能够经过往服务器的网站根目录放置文件的方式来验证

--manual:经过交互式方式,或 Shell 脚本手动获取证书

相关文章
相关标签/搜索