首页 > 服务器 > 启用ssl访问

作者:ghostry 发布时间:2016-01-07 浏览: 3614

转载注明出处: https://blog.ghostry.cn/server/674.html

早就想弄个证书玩玩了。
前两天终于没忍住。在 https://www.wosign.com/ 申请了一个免费证书,说是可以用两年,只能加密不能签名。
证书下载过来有3个文件,首次折腾没有成功,就搁置了。

今天又重新搞了下。
下面贴出关键部分

<VirtualHost *:443>

    ServerName blog.ghostry.cn:443
    ServerAdmin ghostry@ghostry.cn 

...
SSLEngine on

    SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM

SSLCertificateKeyFile /.../3_blog.ghostry.cn.key
SSLCertificateFile /.../2_blog.ghostry.cn.crt
SSLCACertificateFile /.../1_root_bundle.crt

</VirtualHost>

其中的ssl引擎开和三个文件是最重要的。
当然,a2enmod ssl也是要执行的。
这些做完按说就可以了。但是我悲剧的发现我的证书怎么提示是别的域名的。。。找了好久,终于发现原来是我还用了加速乐。于是取消加速乐。终于看到绿色的https了。

最后呢,既然做了https,那么http就舍弃吧。

RewriteEngine On 
#不是https的跳到https
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://blog.ghostry.cn/$1 [R=301,L] 

标签: apache ssl

上一篇: ios上fixed底部输入框被键盘遮挡的简单解决办法
下一篇: 没想到你是这种薯片

添加新评论 »

*
*

欢迎评论!歡迎評論!Comments welcome!komentoj bonvenaj!댓글 오신 것을 환영합니다!
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: :cold: :cryy: :cute: :shy: :sleep: :struggle: :tea: :yahou: