• 全都有综合资源网

    分享赚钱

    一个专业的免费资源网

    每天更新100+优质资源

  • 手机版二维码

    随时手机查素材

  • 扫描二维码

    加入官方微信群

Linux下certpot免费构建https协议

技术文章 每日更新
2024-7-21 18:11 37人浏览 0人回复
原作者: 全都有综合资源网 来自: 全都有综合资源网 收藏 分享 邀请
摘要

codecentos配置Let'sEncrypt并自动更新假如就放在/home下wgethttps://GitHub.com/certbot/certbot/archive/master.zipunzipmaster.zipcdcertbot-master/./certbot-auto--help./certbot-autocertonly--webroot--agree ...

 

Linux下certpot免费构建https协议2707 作者:全都有综合资本网 来历:全都有综合资本网 公布时候:2024-7-21 18:11

layui-box layui-code-view" style="margin-top: 0px; margin-bottom: 10px; padding: 9.5px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); white-space: pre-wrap; overflow-wrap: break-word; box-sizing: border-box; position: relative; font-size: 13px; border: 1px solid rgb(204, 204, 204); background-color: rgb(245, 245, 245); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; overflow: auto; line-height: 1.42857; word-break: break-all; border-radius: 4px;">

code

  1. centos设置Let's Encrypt并自动更新
  2.  
  3. 假如就放在/home下
  4.  
  5. wget https://GitHub.com/certbot/certbot/archive/master.zip
  6.  
  7. unzip master.zip
  8.  
  9. cd certbot-master/
  10.  
  11. ./certbot-auto --help
  12.  
  13. ./certbot-auto certonly --webroot --agree-tos -v -t --email xxxx@qq.com -w /data/xxxx -d xxxx.cn
  14. 假如报错,再履行一遍
  15.  
  16. 然后天生的证书在/etc/letsencrypt/live/下
  17.  
  18. 编辑Nginx设置文件
  19. server {
  20.     listen 443;
  21.     server_name mch.vduok.com;
  22.     ssl on;
  23.     root /var/www/vduok.com/merchant/web;
  24.     index index.HTML index.php;
  25.     ssl_certificate "/etc/letsencrypt/live/mch.vduok.com/fullchain.pem";
  26.     ssl_certificate_key "/etc/letsencrypt/live/mch.vduok.com/privkey.pem";
  27.     ssl_session_cache shared:SSL:1m;
  28.     ssl_session_timeout  10m;
  29.     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  30.     ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
  31.     ssl_prefer_server_ciphers on;
  32.     location / {
  33.         try_files $uri $uri/ /index.php$is_args$query_string;
  34.     }
  35.  
  36.     location ~ \.php$ {
  37.         try_files $uri =404;
  38.         fastcgi_pass 127.0.0.1:9000;
  39.         fastcgi_index index.php;
  40.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  41.         include fastcgi_params;
  42.     }
  43.     location /storage/ {
  44.         alias /var/www/vduok.com/storage/;
  45.     }
  46. }
  47. server {
  48.     server_name mch.vduok.com;
  49.     location / {
  50.         rewrite (.*) https://mch.vduok.com$1 permanent;
  51.     }
  52. }
  53.  
  54. service nginx reload
  55.  
  56. 即可完成SSL的设置,有用期3个月,快到期会自动往上面的邮箱发邮件,背景renew续期即可
  57.  
  58. /home/certbot-master/certbot-auto renew
  59.  
  60. 完成续期
  61.  
  62. 加入按时使命,设备了每周一清晨4点30自动更新证书,并自动重启nginx办事,证书在到期前30天内才能更新,过剩的更新会自动疏忽掉的,每周更新还有一个益处是更新能够会失利,这样最多还有4次的尝试机遇来保证不会过期.
  63.  
  64. 建立剧本 renew-cert.sh
  65.  
  66. #!/bin/bash
  67.  
  68. /home/certbot-master/certbot-auto renew
  69.  
  70. /sbin/service nginx reload
  71.  
  72. 保存剧本,并赐与可履行权限
  73. chmod a+x renew-cert.sh
  74.  
  75. 写入按时使命   crontab -e
  76. 30 4 * * 1 /home/renew-cert.sh >> /home/renew-cert.log 2>&1
  77.  
  78. 保存并重启crontd
  79. service crond restart
  80.  
  81. 完成自动更新证书


©版权免责声明
1、本站所有资源均来自用户上传及互联网。 如有侵权,请联系站长!
2、分享目的仅供大家学习交流。 下载后必须在24小时内删除!
3、不得用于非法商业目的或违反国家法律。 否则,后果自负!
4、本站提供的源代码、模板、插件等资源不包含技术服务。 敬请谅解!
5.如果出现无法下载、无效或有广告的链接,请联系管理员寻求帮助!
6、本站资源价格仅用于赞助,所收取的费用仅用于维持本站日常运营!
7、如果遇到加密压缩包,请使用WINRAR解压。 如果遇到无法解压的加密压缩包,请联系管理员!
8、由于精力有限,很多源代码无法详细测试(解密),部分源代码无法区分为病毒或误报,所以没有进行修改。 请在使用前进行筛选。

路过

雷人

握手

鲜花

鸡蛋
热门教程
专业的免费源码资源分享平台
每天更新100+资源

招募版主发工资

  • 官方在线客服

    QQ客服:红颜

    点击交谈

    在线客服:良子

    点击交谈

    在线客服:闵月

    点击交谈
  • 上海市虹口区海伦中心B座4F4055-4056室

  • 手机扫码查看手机版

    手机查找资源更方便

  • 扫一扫关注官方微信公众号

    加入官方微信

一个专业的免费源码资源互联网分享平台 ©2001-2024 https://www.douyouvip.com全都有综合资源网( 豫ICP备2024057239号-1 )赞助会员|网站地图 HTML
全都有综合资源网,WordPress主题PHP源码,PHP网站源码,网站模板,软件源码,网站源码免费下载,免费网站源码,网站源码模板,免费网站源码下载,wp免费源码,wp免费主题下载,PHP企业网站源码,软件源码下载