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- ...
随机推荐
- Echarts地图使用经验-地图变形和添加数据
关于echart2,echart3地图的使用一点人生经验: 1.echart3,echart2加载地图变形修复. 最近在使用echart2使用过程中,发现加载海南地图会产生变形.如下图,海南地图产生了 ...
- Vue一个案例引发「内容分发slot」的最全总结
今天我们继续来说说 Vue,目前一直在自学 Vue 然后也开始做一个项目实战,我一直认为在实战中去发现问题然后解决问题的学习方式是最好的,所以我在学习一些 Vue 的理论之后,就开始自己利用业余时间做 ...
- 关于Python, ftplib模块中的cwd()进入含中文目录失败的问题
使用Python的ftplib模块连接ftp服务器时, 使用cwd()连接含中文的目录, 报错 : UnicodeEncodeError: 'latin-1' codec can't encode c ...
- 彻底删除mysql服务(清理注册表)
由于安装某个项目的执行文件,提示要卸载MySQL以便它自身MySQL安装,然后我禁用了MYSQL服务,再把这个文件夹删除后,发现还是提示请卸载MYSQL服务. 解决步骤: 1.以管理员身份运行命令提示 ...
- SQL语句(理论)
1.SQL已经成为关系数据库的标准语言 2.SQL是一个非过程化的语言,因为他一次处理一个记录 3.SQL命令比较简单,最高级的命令几天之内便可掌握. 有属下类型的命令: 查询数据. 在表中插入.修改 ...
- c/c++ 多线程 等待一次性事件 packaged_task用法
多线程 等待一次性事件 packaged_task用法 背景:不是很明白,不知道为了解决什么业务场景,感觉std::asynck可以优雅的搞定一切,一次等待性事件,为什么还有个packaged_tas ...
- JavaScript对象类型之简单介绍
引言 对象是JavaScript的基本数据类型. 对象是一种复合值:将很多值(原始值或者其他对象)聚合在一起,通过名字访问这些值. 对象可以看做属性的无序集合,每个属性都是一个名/值对.属性名是字符串 ...
- Extending the Yahoo! Streaming Benchmark
could accomplish with Flink back at Twitter. I had an application in mind that I knew I could make m ...
- 慢日志查询python flask sqlalchemy慢日志记录
engine = create_engine(ProdConfig.SQLALCHEMY_DATABASE_URI, echo=True) app = Flask(__name__) app.conf ...
- centos7下kubernetes(13。kubernetes-探讨service IP)
service cluster IP是一个虚拟IP,是由kubernetes节点上的iptables规则管理的 通过iptables-save | grep 10.105.215.156看到与clus ...