# centos7使用certbot报python错误 URL: https://chengjinfang.com/posts/2017/linux-certbot/ Author: 程锦方 Date: 2017-08-01 Tags: #linux #note Summary: CentOS 7 上运行 Certbot 遇到 Python 错误后的安装与证书生成记录。 ------------------------------------------------------------------------ ## 遇到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 you@example.com -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/ ------------------------------------------------------------------------ Site: https://chengjinfang.com/ · All Index: https://chengjinfang.com/all/ · RSS: https://chengjinfang.com/rss.xml