免费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.log
      Error 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:15
      nginx: configuration file /etc/nginx/nginx.conf test failed Could 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. -结束

oneinstack 安装 https-certbot的更多相关文章

  1. C#检测并安装https站点的数字证书,CefSharp和HttpWebRequest通过会话Cookie实现自动登录访问https站点

    HttpUtil工具类: using System; using System.Collections.Generic; using System.IO; using System.Linq; usi ...

  2. OneinStack 安装 LNMP 切换PHP版本

    如果你的环境不是OneinStack安装的  ,可以略过这条博客了 注意:以下所有命令若提示权限不足 请在命令前加 sudo *** ①,首先查看当前已安装的PHP版本,我这里安装了好几个版本,你们可 ...

  3. 小米手机安装https证书报错:无法安装该证书 因为无法读取该证书文件

    Fiddler]手机安装https证书报错:无法安装该证书 因为无法读取该证书文件   之前在手机上使用 “ip:端口号” 的方法就能直接在手机上自动下载安装fiddler证书,但是现在有些手机并不能 ...

  4. Charles安装https证书

    Charles抓取https的包,出现unknow,需要安装https证书.

  5. Let's Encrypt: 为CentOS/RHEL 7下的nginx安装https支持-具体案例

    环境说明: centos 7 nginx 1.10.2 前期准备 软件安装 yum install -y epel-release yum install -y certbot 创建目录及链接 方法1 ...

  6. 阿里云中ssl配置(nginx安装https服务)

    1.配置 a.阿里云服务器 b.安装了nginx,php等 2.申请免费ssl证数 a. b. c.产看ssl证数 d.下载证数 e,这里我下载的是nginx(crt与key文件) f.服务器上配置 ...

  7. OneinStack 安装

    安装步骤 注意 如果有单独数据盘,建议您先挂载数据盘,建议将网站内容.数据库放在数据盘中.如何挂载数据盘,请参考(支持阿里云.腾讯云):<如何利用脚本自动化挂载数据盘?> yum -y i ...

  8. linux apache安装https证书

    1.首先查看是否安装apache 命令:rpm -qa|grep httpd 如果存在,卸载命令:rpm -e XXXX 如果不存在,安装命令:yum install httpd 安装完apache之 ...

  9. 插件油泼猴+脚本 for chrome 安装 - https://greasyfork.org/zh-CN

    http://chromecj.com/utilities/2018-09/1525.html 一.将 *.crx 改名为 *.zip 二.访问 chrome://flags/#extensions- ...

随机推荐

  1. XUnit 依赖注入

    XUnit 依赖注入 Intro 现在的开发中越来越看重依赖注入的思想,微软的 Asp.Net Core 框架更是天然集成了依赖注入,那么在单元测试中如何使用依赖注入呢? 本文主要介绍如何通过 XUn ...

  2. Windows系统下搭建Git本地代码库

    近由于工作需要,要把工作代码做一下版本管理.工作代码也不方便放到github上,也不想付费建私密库,公司也没几个人,所以就想着搭建一个本地Git版本库,来做版本管理.搭建过程如下. 系统环境:Dell ...

  3. 生成Csv格式的字符串

    using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Sy ...

  4. c/c++ 继承与多态 继承中的public, protected, private

    问题:类B私有继承类A,类A有个protected成员,那么在类B的成员函数里是否可以使用类A的protected成员? 可以使用. 估计有的同学说不对吧,类B都私有继承了类A了,怎么还能访问类A的p ...

  5. md5sum的使用

    通过md5sum可以对文件做哈希校验,用来验证文件完整性. 批量生成校验值 $ find . -iname "*.mp4" -exec md5sum -t {} \; >/t ...

  6. Linux Collection:文本编辑问题

    PAS 删除文本中的^M标记 由于历史原因,不同操作系统使用不同的方式表示文件的换行符\n.现代计算机系统中的文件换行和早期的打字机有关,主要和两个控制符有关:line feed (LF) ,carr ...

  7. 前端面试必备的css盒子模型

    今天同学发给了我一份前端基础的面试题,第一道便是对css盒子模型的理解,我看到的第一眼想到的是div,然后就...懵逼了,知其然不知其所以然.所以打算写一写盒子模型的概念理解啥的,如有写的不当的地方, ...

  8. C#基础知识之静态和非静态

    项目中静态和非静态常被用到,什么时候需要用静态的,什么时候需要使用非静态,以及他们的区别是什么? 一.概述 静态和非静态的不同地方,就是静态从程序一启动就会一直占用内存,而非静态只有在实例化的时候才会 ...

  9. 查看jar包的jdk版本

  10. 如何用php实现分页效果

    分页效果在网页中是常见的,可是怎样才能实现分页呢,今天做了两种方法来实现一下分页的效果 首先,我们需要准备在数据库里面准备一个表,并且插入数据,这些都是必需的前提工作了,不多说,如图所示(库名为jer ...