锦方的个人网页

centos7使用certbot报python错误

发布 · 约 63 字 · 预计 1 分钟

CentOS 7 上运行 Certbot 遇到 Python 错误后的安装与证书生成记录。

归档记录:本文最后更新于 2017 年,文中涉及的软件版本、配置或命令可能已随环境演进发生变化。

本文目录(共 6 节)

遇到centos7使用certbot报python错误后的安装方法 #

获取certbot客户端 #

wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto

停止nginxyunx #

service nginx stop

生成证书 #

./certbot-auto certonly --standalone --email `你的邮箱地址` -d `你的域名地址`
当前网站有多个域名时需在后面增加,例如
./certbot-auto certonly --standalone --email [email protected] -d example.com -d www.example.com

查看生产的证书 #

tree /etc/letsencrypt/live/

将证书用于nginx在nginx网站配置文件中增加

###证书位置

ssl_certificate "/etc/letsencrypt/live/example.com/fullchain.pem";
ssl_certificate_key "/etc/letsencrypt/live/example.com/privkey.pem";

启动nginx #

service nginx start

/posts/2017/install-certificates/

✉ 对本文有补充或勘误?欢迎就本文写信交流。