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- ...
随机推荐
- Dynamics 365新特性介绍:在视图中显示图片和提示
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复242或者20161230可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...
- 基础环境系列:Apache2.4.37
一.安装 进入官网http://www.apache.org/,滑至最下方,排名第一的HTTP Server就是我们需要的. 当前时间的最新版本是2.4.37.呃……并没有msi版本,我们选择最后一个 ...
- elasticsearch常用命令
elasticsearch的rest访问格式: curl -X<REST Verb> <Node>:<Port>/<Index>/<Type> ...
- C# 一般处理程序ashx接收服务端post过来json数据
这个和前端js的接收方式有点不一样,前端接收用request.form["xxx"]即可
- JS中简单的二级城市联动
代码奉上: <!DOCTYPE html><html><head> <meta charset="UTF-8"> < ...
- Linux内核最新的连续内存分配器(CMA)——避免预留大块内存【转】
在我们使用ARM等嵌入式Linux系统的时候,一个头疼的问题是GPU,Camera,HDMI等都需要预留大量连续内存,这部分内存平时不用,但是一般的做法又必须先预留着.目前,Marek Szyprow ...
- 面相服务的架构SOA
SOA体系结构是基于服务组件模型,将应用程序的不同功能单元通过定义良好的接口契约联系起来,接口是采用中立方式进行定义的,独立于实现服务的硬件平台,操作系统和编程语言.使得构建在这样的系统中的服务可以以 ...
- Canadian-dollar_RMB
import pandas as pd import matplotlib.pyplot as plt import statsmodels as sm from statsmodels.graphi ...
- MongoDB的导入与导出
一.导入与导出可以操作本地的mongodb也可以是远程的mongodb,通用选项: -h host 主机 --port port 端口 -u username 用户名 -p password 密码 如 ...
- ubuntu系统下mysql重置密码和修改密码操作
一.忘记密码后想重置密码 在介绍修改密码之前,先介绍一个文件/etc/mysql/debian.cnf.其主要内容如下图: 里面有一个debian-sys-maint用户,这个用户只有Debian或U ...