kangle web server使用Let’s Encrypt

本人自己的网站是用kangle web server搭建的,最近腾讯的免费1年的证书到期后,准备换成Let's Encrypt! 网上大部分都是讲的nginx跟apache的配置教程,发现kangle的极少,经过google终于搞定,现记录下来,方便查询!

准备环境

本人的vps为CentOS release 6.9 (Final),准备工作:

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

接下来自动安装所需的依赖包

生成证书

  • 单域名证书

example:certbot-auto certonly --email 你的邮箱 --agree-tos --webroot -w 你的网站路径 -d 你的网站域名

./certbot-auto certonly --email 5030699@qq.com --agree-tos --webroot -w /home/ftp/s/sscat/wwwroot/ -d sscat.wang
  • 多域名证书

example:certbot-auto certonly --email 你的邮箱 --agree-tos --no-eff-email --webroot -w 你的网站路径 -d 绑定的域名1 -d 绑定的域名2 -d 绑定的域名3

./certbot-auto certonly --email 5030699@qq.com --agree-tos --no-eff-email --webroot -w /www/wwwroot/shunzi/  -d zhengshun.wang  -d imshunzi.com -d shunzi.me

提示如下就表示生成成功了!

IMPORTANT NOTES:
– Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/zhengshun.wang/fullchain.pem. Your cert will
expire on 2018-10-01. To obtain a new or tweaked version of this
certificate in the future, simply run certbot-auto again. To
non-interactively renew *all* of your certificates, run
“certbot-auto renew”
– If you like Certbot, please consider supporting our work by:

Donating to ISRG / Let’s Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le

新生成的证书保存在:/etc/letsencrypt/live/zhengshun.wang/

使用证书

大家知道,如要要开启https需要kangle web server启用443端口,

  • easypanel相关设置:

    1. 开通网站时端口写80,443s【假如是已经创建了的,就点击所有网站,然后点击修改,高级选项,端口那里填80,443s 即可】,
    2. 然后点击网站名称到该虚拟主机后台,就能看到SSL证书选项了,ssl证书内容那个框复制/etc/letsencrypt/live/zhengshun.wang/fullchain.pem里面的内容,
    3. ssl证书密钥内容那个框复制/etc/letsencrypt/live/zhengshun.wang/privkey.pem里面的内容,
    4. 然后点击提交,状态成功表示没问题,要http访问自动跳转到https,拿伪静态301强制跳转到https即可。
  • 软连接设置

    1. 需要网站启用ssl,即监听443端口
    2. 通过软连接绑定证书
      ln -s /etc/letsencrypt/live/zhengshun.wang/fullchain.pem  /home/ftp/s/shunzi/ssl.crt
      ln -s /etc/letsencrypt/live/zhengshun.wang/privkey.pem  /home/ftp/s/shunzi/ssl.key

证书到期续期

如果证书到期后,可以使用下列命令进行续期 /root/certbot-auto renew 一般快要到期时,你会收到相应邮件,然后去网站再续一次即可。 也可以添加到crontab任务进行自动续期

echo "0 3 * */3 * root /root/certbot-auto renew > /root/renew.log 2>&1" >> /etc/crontab
service crond restart

小结

Let's Encrypt目前来看是非常好用的一个免费ssl证书服务商,如果是做个人网站的话,那就来试试吧!

官网:https://letsencrypt.org/

继续阅读
Vultr 新用户注册就送100$
shunzi
  • 本文由 发表于 2018-03-0214:37:06
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
ChatGPT注册教程 Network

ChatGPT注册教程

最近ChatGPT真受欢迎,但是有些人注册时会经常面临不服务它们的地区问题,现在我们给你详细问题解决。 准备 代理。要求是韩国,日本,印度,新加坡,美国这些国家的地址都合适。对其他的我们还不太清楚,反...
deepin linux v20.2系统安装 BLOG

deepin linux v20.2系统安装

安装Deepin V20.2系统 最近因为学习需要,换了一台电脑,完了又是系统的安装。总之,docker环境折腾我了一个多星期。最后完美搞定。 ............ shunzi@thinkpad...
deepin linux V20系统安装 BLOG

deepin linux V20系统安装

安装系统 系统安装就不说了,网上一大把。以前用deepin linix 15.11系统非常舒服,后来因为办公环境需要,期间又换回windows,目前因为彻底能用linux办公了。一个字爽~ 系统跟新 ...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: