这篇文章主要讲解了“https证书怎么申请”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“https证书怎么申请”吧!
下面介绍两种比较简单的申请方式: 使用网站 https://freessl.cn/ 在线免费申请有效期为一年的证书。 **获取certbot客户端** wget https://dl.eff.org/certbot-auto chmod a+x certbot-auto **停止nginx/apache** systemctl stop nginx **生成证书** ./certbot-auto certonly --standalone --email `你的邮箱地址` -d `你的域名地址` 当前网站有多个域名时需在后面增加,例如: ./certbot-auto certonly --standalone --email `你的邮箱地址` -d `你的域名1` -d `你的域名2` **查看生产的证书** tree /etc/letsencrypt/live/ **将证书用于nginx** 添加到server 字段下 listen 443 ssl http2; server_name domain_name; root /usr/share/nginx/html; ssl_certificate /etc/letsencrypt/live/domain_name/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/domain_name/privkey.pem; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; **目前已经配置好https了,下面进行自动续期操作** 将下面内容添加到任务计划就可以自动续期了。 0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew **启动nginx/apache** systemctl start nginx
免责声明:本站发布的内容(图片、视频和文字)以原创、来自互联网转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:ts@56dr.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。
Copyright © 2009-2021 56dr.com. All Rights Reserved. 特网科技 版权所有 珠海市特网科技有限公司 粤ICP备16109289号
域名注册服务机构:阿里云计算有限公司(万网) 域名服务机构:烟台帝思普网络科技有限公司(DNSPod) CDN服务:阿里云计算有限公司 中国互联网举报中心 增值电信业务经营许可证B2