标签 certbot 下的文章

免费SSL安全证书Let's Encrypt(certbot)安装使用教程

Let's Encrypt是很火的一个免费SSL证书发行项目,自动化发行证书,证书有90天的有效期。适合个人使用或者临时使用,不用再忍受自签发证书不受浏览器信赖的提示。去年二蛋曾经记录过Let's Encrypt的使用教程,但是Let's Encrypt已经发布了新的工具certbot,虽然是新工具,但是生成证书的使用方法和参数是基本一致的,证书续期更简单了。但是目前看certbot在一些老版本的Linux发行版上的兼容性还是有问题的,特别是在CentOS 5上,因为python版本过低是无法使用的,CentOS 6上需要先安装epel才行。

安装方法:

如果是CentOS 6、7,先执行:

yum install epel-release
cd /root
wget https://dl.eff.org/certbot-auto --no-check-certificate
chmod +x ./certbot-auto
./certbot-auto -n

./certbot-auto -n只是用来安装依赖包的,也可以跳过直接到下面的生成证书的步骤,国内VPS或服务器上使用的话建议先修改为国内的pip源。

单域名生成证书:

./certbot-auto certonly --email [email protected] --agree-tos --webroot -w /home/wwwroot/www.2dan.cc -d www.2dan.cc

多域名单目录生成单证书:(一个网站多个域名使用同一个证书)

./certbot-auto certonly --email [email protected] --agree-tos --webroot -w /home/wwwroot/www.2dan.cc -d www.2dan.cc -d 2dan.cc

多域名多目录生成多个证书:(一次生成多个域名的多个证书)

./certbot-auto certonly --email [email protected] --agree-tos --webroot -w /home/wwwroot/www.2dan.cc -d www.2dan.cc -d 2dan.cc -w /home/wwwroot/www.caibaoz.com -d www.caibaoz.com -d caibaoz.com

- 阅读剩余部分 -