博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
oneinstack 安装 https-certbot
阅读量:4556 次
发布时间:2019-06-08

本文共 1948 字,大约阅读时间需要 6 分钟。

 

免费https?   官方安装教程:https://certbot.eff.org/#centos6-nginx (以下是说明安装时遇到的);

  1. 下载并修改文件权限
    wget https://dl.eff.org/certbot-auto && chmod a+x certbot-auto

      

  2. 执行:
    1.  ./certbot-auto --nginx certonly   或是 ./certbot-auto --nginx
      报错:xx包........出错;请 yum update 更新一下;
      报错:一般情况oneinstack 把nginx 没有安装在 /etc 目录:
      WARNING: unable to check for updates.Saving debug log to /var/log/letsencrypt/letsencrypt.logError while running nginx -c /etc/nginx/nginx.conf -t.nginx: [emerg] open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:15nginx: configuration file /etc/nginx/nginx.conf test failedCould not choose appropriate plugin: The nginx plugin is not working; there may be problems with your existing configuration.The error was: MisconfigurationError('Error while running nginx -c /etc/nginx/nginx.conf -t.\n\nnginx: [emerg] open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:15\nnginx: configuration file /etc/nginx/nginx.conf test failed\n',)The nginx plugin is not working; there may be problems with your existing configuration.The error was: MisconfigurationError('Error while running nginx -c /etc/nginx/nginx.conf -t.\n\nnginx: [emerg] open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:15\nnginx: configuration file /etc/nginx/nginx.conf test failed\n',)

        解决方案:执行:

      /certbot-auto --nginx --nginx-server-root=/usr/local/nginx/conf

       

    2. 选择 7; 需要添加HTTPS的域名

    3. 选择2;全部使用HTTPS

  3. 完成;此时访问域名,便是https请求方式了。
  4. 默认免费证书时间是有限的。需要更新达到续签; (/root/certbot-auto 为本人 certbot 安装目录)
    1. 手动续签
      /root/certbot-auto renew

        

    2. 自动续签
      执行:
      crontab -e

        写入:每天零点到十二点更新一次;

      0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && /root/certbot-auto renew

        也可以:30 2 * */2 * certbot renew –pre-hook “service nginx stop” –post-hook “service nginx start”     ——  每隔两个月凌晨2:30更新:

    3. 续签完成:并显示过期时间  crontab -l 可查看任务详情;

       

  5. -结束

 

转载于:https://www.cnblogs.com/q1104460935/p/9459139.html

你可能感兴趣的文章
[转]微擎应用笔记3--manifest.xml文件使用说明
查看>>
Codeforces 1000C Covered Points Count 【前缀和优化】
查看>>
python高效读取文件、文件改写
查看>>
gulp
查看>>
pgsql查询优化之模糊查询
查看>>
不变模式
查看>>
matlab去云雾
查看>>
500lines项目简介
查看>>
Asp.net core logging 日志
查看>>
BOM浏览器对象模型
查看>>
Jq 遍历each()方法
查看>>
Android源码分析:Telephony部分–phone进程
查看>>
关于 redis.properties配置文件及rule
查看>>
WebService
查看>>
关于Java中重载的若干问题
查看>>
Java中start和run方法的区别
查看>>
23种设计模式中的命令模式
查看>>
[转载]年薪10w和年薪100w的人,差在哪里?
查看>>
shell 日期参数
查看>>
package的使用
查看>>