为个人站点添加SSL证书

在百度云购买了.cc域名,只需要245/10年,相当于24.5每年,然后为了节约每年花在主机上的费用,将博客服务器搬迁到自己的raspberry Pi2上了,而中国电信将80端口封闭,虽然申请了公网IP,也无可奈何,只能用SSL登录。而wordpress的Jetpack服务以及安卓客户端对于SSL连接是有要求的,个人证书没用,必须要专门的机构认证。

我记得以前机构认证费用挺高,不过现在由于各互联网公司的推动,SSL连接反而是个必须的了。下面用免费的方式获取机构证书。

1.访问页面:https://letsencrypt.org/getting-started/

2.我是用Shell Access的方式,那么继续访问 https://certbot.eff.org/

3.选择自己的软件和系统,我的是Apache和ubuntu 17.04,估计暂时不能升到17.10了吧

4.安装认证包:

 

 

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache

sudo certbot –apache

5.只有180天的有效期,如果需要续租证书,可以使用如下命令:

sudo certbot –apache certonly

也可以先测试自动续租的命令:

sudo certbot renew –dry-run

如果测试成功,那么将certbot renew加入到定时运行中。

sudo nano /etc/crontab

10 0 * */3 * root certbot renew

6.现在试试用Jetpack和安卓客户端连接博客试试~~OK!


评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注