HTTPS简单配置探索
借助这个开源项目certbot for Apache可以很方便的配置好免费的SSL证书(Let's Encrypt
)
如果要用在不同的Web Server上的话,可以在certbot index 查看文档
Let’s Encrypt是很火的一个免费SSL证书发行项目,自动化发行证书,证书有90天的有效期。
如果是CentOS 6、7,先执行:yum install epel-release
cd /root/
- 下载cerbot-auto
wget https://dl.eff.org/certbot-auto --no-check-certificate
- 赋予cerbot-auto执行权限
chmod +x ./certbot-auto
./certbot-auto -n
安装相关依赖包
因为给pip默认的源是国外的,所以如果服务器是在国内的话,安装可能会比较慢.如果等了很久都卡在Installing Python packages的话,可以尝试修改一下pip源
修改pip源见下
|
|
安装完cerbot-auto
之后,运行./certbot-auto
,根据要求来输入
这里可以选择是否允许http,如果选择了Secure模式的话,访问HTTP也会被自动跳转到HTTPS的
Apache的配置文件会自动生成在/etc/httpd/conf.d/ssl.conf
文件中
续期
因为证书只有90天,你可以在定时脚本或系统任务中执行这条语句~/certbot-auto renew --dry-run