博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用免费SSL证书让网站支持HTTPS访问
阅读量:4652 次
发布时间:2019-06-09

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

参考掘金的文章,掘金的文章最详细。

https://juejin.im/post/5a31cbf76fb9a0450b6664ee

 

先检查是否存在 EPEL 源:

# 进入目录检查是否存在 EPEL 源,一般情况文件名称 epel.repocd /etc/yum.repos.d/

如果不存在可以直接安装

sudo yum install epel-release -y

安装签发证书工具

 

sudo yum install certbot-nginx -y

来了

报nginx配置文件目录不对错误

sudo certbot --nginx# Saving debug log to /var/log/letsencrypt/letsencrypt.log# Error while running nginx -c /etc/nginx/nginx.conf -t.# nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)# nginx: configuration file /etc/nginx/nginx.conf test failed # 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: [eme
解决方法,这个解决方法就是让
certbot认为你的,你的配置存在,并且将SSL配置写入你的nginx配置文件中,然后拷贝配置到你的默认 nginx 配置中。哈哈为了方便 nginx 启动不用指定配置,也没有看到
certbot 工具提供指定目录的命令,暂时我就这么解决吧。
# nginx 默认配置文件目录不 /etc/nginx/ 目录下,
# 需要拷贝/usr/local/nginx/conf目录下的全部文件
# 复制到/etc/nginx/目录下
cp -r /usr/local/nginx/conf/* /etc/nginx/
# 编辑开机启动将所有目录换成/etc/nginx/
vim /lib/systemd/system/nginx.service
cp /lib/systemd/system/nginx.service{,.bak}
# 测试配置是否正确
nginx -t -c /etc/nginx/nginx.conf

作者:小弟调调™
链接:https://juejin.im/post/5a31cbf76fb9a0450b6664ee
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
 

 

转载于:https://www.cnblogs.com/ZHONGZHENHUA/p/9005496.html

你可能感兴趣的文章
教程-Win7极速优化20项
查看>>
CF1083B The Fair Nut and String
查看>>
mac上卸载jdk 步骤
查看>>
Old Sorting(转化成单调序列的最小次数,置换群思想)
查看>>
C的|、||、&、&&、异或、~、!运算(转)
查看>>
迷宫城堡(强联通targin)
查看>>
easyUI添加修改tab页(toolbar)
查看>>
JavaScript笔试题
查看>>
Leetcode 969. Pancake Sorting
查看>>
set()集合的概念与一般操作
查看>>
winform - ComboBox_ListView2
查看>>
react中递归生成列表
查看>>
内置函数filter
查看>>
FIREDAC TFDCONNECTION连接ORACLE
查看>>
【LeetCode从零单排】No 114 Flatten Binary Tree to Linked List
查看>>
Effective Go(官方文档)笔记
查看>>
Spring表达式语言SpEL简单介绍
查看>>
NancyFX 第八章 内容协商
查看>>
操蛋的一天
查看>>
20172324 2017-2018-2 《程序设计与数据结构》第八周学习总结
查看>>