1. 申请SSL证书
这里我用的是腾讯云的免费SSL,像阿里云、景安什么的也有免费的,据说审核也很快
2. typecho设置
登录Typecho后台 -> 设置 -> 基本设置 -> 站点地址改成https的域名
编辑Typecho站点根目录下的文件config.inc.php
加入下面一行配置
/** 开启HTTPS */
define('__TYPECHO_SECURE__',true);
如果是自带的评论系统,也要改一点东西,因为我采用第三方评论就不用改了,详见第一个参考链接
3. Lighttpd设置
编辑/etc/lighttpd/lighttpd.conf
,加入
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/ssl/server.pem" //个人域名证书
ssl.ca-file = "/etc/lighttpd/ssl/ca-root.bundle.crt" //证书链
server.name = "example.com" //你的域名
server.document-root = "/var/www/" //lighttpd的网站根目录
}
//下面这一段用于将HTTP连接跳转为HTTPS连接
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ ".*" {
url.redirect = (".*" => "https://%0$0")
}
}
编辑/etc/lighttpd/modules.conf
,取消注释打开mod_redirect
server.modules += ( "mod_redirect" )
配置证书文件。server.pem
为腾讯云提供下载的证书中IIS版的pfx文件转换成的pem文件,在线转换网址在文末工具链接1给出;ca-root.bundle.crt
文件为证书链,详细可看下参考资料5、6,如果不安装这个,在安卓平台的浏览器上会显示证书不可信任,获取方法是在线上传IIS版的pfx文件,而后获取下载,获取链接在文末工具链接2给出。
至此,service lighttpd restart
重启lighttpd,完成全站开启HTTPS,想进一步研究文末给出了一些链接,我也没怎么弄懂,留给有兴趣的小伙伴们,至少,UC不能劫持我们加广告啦~
- 参考链接
typecho全站启用HTTPS教程 – 小z博客
Docs SSL – Lighttpd – lighty labs
HowToRedirectHttpToHttps – Lighttpd – lighty labs
Lighttpd – ArchWiki
AlphaSSL 证书被 Android 的 UC、360、Chrome、小米自带的浏览器显示不信任 – V2EX
Lighttpd 配置 SSL – SSL.DO 支持文档
- 工具链接
SSL Converter – Convert SSL Certificates to different formats
证书链下载/证书链修复
- 深入研究
系统运维|在 Apache、NGINX 和 Lighttpd 上启用 HTTP 公钥固定扩展(HPKP)
SSL状态检测
SSL证书_HTTPS证书_免费SSL证书申请_SSL证书购买_全球SSL数字证书领导者 – 亚洲诚信/TrustAsia
SSL Server Test (Powered by Qualys SSL Labs)
文章来源于互联网:Lighttpd/typecho全站启用HTTPS
I am so happy to read this. This is the type of manual that needs to be given and not the accidental misinformation that’s at the other blogs. Appreciate your sharing this best doc.
cialis buy online usa Primary diagnosis of a breast mass for same day surgical management
That is the most inaccurate statement I ve ever heard buy cialis online using paypal 192 Postdive exercise is believed to dilate intrapulmonary arteriovenous anastomoses
buy cialis with paypal Bresalier RS, Sandler RS, Quan H, et al
Women who received chemotherapy in conjunction with Tamoxifen performed even more poorly than the group who received chemotherapy alone buy cialis with paypal Sleep 1992; 15 4 330 336
Geraghty advises people with keratosis pilaris to cleanse with a mild, nondrying soap, and to also use thick, plain moisturizer, since dry skin can exacerbate the condition clomiphene for low testosterone 58 248 furosemide or aldic or aluzine or anfuramaide or aquarid or arasemide or cetasix or desal or diamazon or dirine or discoid or diumide or diural or diuresal or diurin or diurix or diurolasa or diusemide or diuspec or dryptal or durafurid or edenol or errolon or eutensin or eutensine or flurosemide or franyl or fretic or frumid or frusedan or frusehexal or frusema or frusemidor frusemide or frusid or fruzex or fumarenid or fumide or furanthril or furantral or furantril or furanturil or furasemide or furesin or furesis or furetic or furix or furmid or furo puren or furo basan or furo puren or furobasan or furomen or furomex or furomide or furomin or furopuren or furorese or furosamide or furoscan or furose or furosemid or furosemix or furosimide or furosix or furovite or fursemide or fusid or fusimex or hissuflux or hydro rapid or impugan or jufurix or kofuzon or kutrix or lasiletten or lasilix or lasix or laxis or laxur or lb 502 or lb502 or luramide or marsemide or mirfat or odemase or odemex or oedemase or oedemex or pharmix or promedes or radisemide or rasitol or retep or salinex or seguril or selectofur or sigasalur or uremide or uresix or urex m or vesix or zafurida