oneinstack 安装 https-certbot

免费https? 官方安装教程:https://certbot.eff.org/#centos6-nginx (以下是说明安装时遇到的);
- 下载并修改文件权限
wget https://dl.eff.org/certbot-auto && chmod a+x certbot-auto
- 执行:
- ./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

选择 7; 需要添加HTTPS的域名
选择2;全部使用HTTPS
- ./certbot-auto --nginx certonly 或是 ./certbot-auto --nginx
- 完成;此时访问域名,便是https请求方式了。
- 默认免费证书时间是有限的。需要更新达到续签; (/root/certbot-auto 为本人 certbot 安装目录)
- 手动续签
/root/certbot-auto renew
- 自动续签
执行: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更新:
- 续签完成:并显示过期时间 crontab -l 可查看任务详情;

- 手动续签
- -结束
oneinstack 安装 https-certbot的更多相关文章
- C#检测并安装https站点的数字证书,CefSharp和HttpWebRequest通过会话Cookie实现自动登录访问https站点
HttpUtil工具类: using System; using System.Collections.Generic; using System.IO; using System.Linq; usi ...
- OneinStack 安装 LNMP 切换PHP版本
如果你的环境不是OneinStack安装的 ,可以略过这条博客了 注意:以下所有命令若提示权限不足 请在命令前加 sudo *** ①,首先查看当前已安装的PHP版本,我这里安装了好几个版本,你们可 ...
- 小米手机安装https证书报错:无法安装该证书 因为无法读取该证书文件
Fiddler]手机安装https证书报错:无法安装该证书 因为无法读取该证书文件 之前在手机上使用 “ip:端口号” 的方法就能直接在手机上自动下载安装fiddler证书,但是现在有些手机并不能 ...
- Charles安装https证书
Charles抓取https的包,出现unknow,需要安装https证书.
- Let's Encrypt: 为CentOS/RHEL 7下的nginx安装https支持-具体案例
环境说明: centos 7 nginx 1.10.2 前期准备 软件安装 yum install -y epel-release yum install -y certbot 创建目录及链接 方法1 ...
- 阿里云中ssl配置(nginx安装https服务)
1.配置 a.阿里云服务器 b.安装了nginx,php等 2.申请免费ssl证数 a. b. c.产看ssl证数 d.下载证数 e,这里我下载的是nginx(crt与key文件) f.服务器上配置 ...
- OneinStack 安装
安装步骤 注意 如果有单独数据盘,建议您先挂载数据盘,建议将网站内容.数据库放在数据盘中.如何挂载数据盘,请参考(支持阿里云.腾讯云):<如何利用脚本自动化挂载数据盘?> yum -y i ...
- linux apache安装https证书
1.首先查看是否安装apache 命令:rpm -qa|grep httpd 如果存在,卸载命令:rpm -e XXXX 如果不存在,安装命令:yum install httpd 安装完apache之 ...
- 插件油泼猴+脚本 for chrome 安装 - https://greasyfork.org/zh-CN
http://chromecj.com/utilities/2018-09/1525.html 一.将 *.crx 改名为 *.zip 二.访问 chrome://flags/#extensions- ...
随机推荐
- Android细笔记--DataStorage
Shared Preferences 即使应用被杀了,shared preference也还是存在的 Internal Storage 创建于internal的文件只对本应用开放权限,即使手机用户本身 ...
- Monkey测试记录
配置环境变量,不然用不了adb命令 path这里也一样配置一下 命令的各种意思百度一下看看也就知道了 看到一篇博客推荐的一种测试命令,我也直接拿来用了 adb shell monkey -p 你的包名 ...
- mssql sqlserver 指定特定值排在表前面
转自:http://www.maomao365.com/?p=7141 摘要: 下文讲述sql脚本编写中,将 特定值排在最前面的方法分享, 实验环境:sqlserver 2008 R2 例:将数据表中 ...
- 龙尚 U9300C wvdial 拨号上网
龙尚 U9300C 7模 4G LTE (国内全网通) 接入linux系统会有4个串口 其中ttyUSB2 为AT指令口 ttyUSB1 为拨号上网口 wvdial 拨号入网参数 [ ...
- Linux/Unix环境下的make命令详解
https://blog.csdn.net/wxqian25/article/details/21226711
- ansible学习基础知识和模块(一)
基础知识补充: 常用自动化运维工具 Ansible:使用python来开发的,无需设置Agentless(代理),一般管理几百台.与ssh的方式也不一样,ssh是基于c/s模式(客户端+服务器)来使用 ...
- adb.exe 安卓测试桥的使用
一.android SDK提供了几个工具 (在SDK下build-tools目录下的工具) dx.bat ----------->把java编译器编译生成的.class 文件 ,变成一个文件,让 ...
- Ubuntu下安装JDK详细教程
Ubuntu下安装JDK详细教程 作者:凯鲁嘎吉 - 博客园http://www.cnblogs.com/kailugaji/ Ubuntu版本:Ubuntu-12.04.5-desktop-i386 ...
- 自定义JDBC链接池
上篇简单介绍了jdbc链接数据库: 本篇就说一下自定义连接池以及增删改查的测试: 自定义连接池 自定义链接池的原因 JDBC连接中用到Connection 在每次对数据进行增删查改 都要 开启 ...
- 详解vuex结合localstorage动态监听storage的变化
这篇文章主要介绍了详解vuex结合localstorage动态监听storage的变化,小编觉得挺不错的,现在分享给大家,也给大家做个参考.一起跟随小编过来看看吧 需求:不同组件间共用同一数据,当一个 ...