1G全能免费空间 | 2GB免费全能空间 | 1G免费全能空间 | 免费试用云服务器 | 国内1G免费空间 | 免费空间 | 免费空间申请
您的位置:首页 > 免费教程

织梦Dedecms程序开启https教程

作者:免费空间 发布时间:2018-02-27 [手机版]

现在越来越多的网站开始使用https协议,其实百度从2014年底就已经开始支持https了,并且据说在排名上,同权重的网站,开启https会优待提升排名。先不管排不排名吧,https是一种更安全更先进的技术。作为互联网的弄潮儿,我们必须要与时俱进呀~果断的,全站启用https协议。下面具体说一下https的开启步骤:
一,申请SSL证书
有些小白会以为开启https只是在网址http后面加个s就可以了,其实不是的。https是需要验证SSL证书的,如果没有证书或者证书不匹配,则通过https访问你的网站是会被浏览器拦截的。
免费空间
ssl证书是开启https的必要前提,证书有付费的,有免费的,腾讯云阿里云等各大云服务商都有提供免费的ssl证书。下面举腾讯云的例子:
1.注册腾讯云
http://partners.qcloud.com/invitation/996681198582ad35c39528
2.关联我司作为服务商(非必要条件,友情关联)
免费空间
3.申请SSL证书
https://console.qcloud.com/ssl
免费空间
免费空间
免费空间
免费空间
免费空间
二,上传SSL证书到服务器
腾讯云面板下载的SSL证书压缩包里面包含各种服务器引擎的证书,你需要选择你的服务器类型
比如我们用的是Nginx服务器,就需要上传Nginx专用的SSL证书。如果是IIS,就上传IIS专用的

三,服务器虚拟主机设置SSL证书路径
上传了SSL证书之后,我们还需在虚拟主机配置文件里面指定一下SSL证书的路径,不然访问会出错。
别的服务器我们并不了解。但是就我们现在用的WDCP面板+Nginx配置文件的写法是。你需要先找到
你服务器虚拟主机配置文件的路径,我们的是/conf/vhost/idedecms.com.conf各有不同,举一反三。

server {
        listen       80;
        root /www/web/idedecms_com/public_html;
        server_name idedecms.com idedecms.com www.idedecms.com img.idedecms.mysitecdn.com;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        error_page  503 /errpage/503.html;
        location ~ \.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
        }
        location ~ /\.ht {
                deny  all;
        }
        location / {
                try_files $uri @apache;
        }
        location @apache {
                 proxy_pass http://127.0.0.1:88;
                 include naproxy.conf;
        }
return 301 https://www.$server_name$request_uri;
}
server {
listen 443 ssl;
        root /www/web/idedecms_com/public_html;
        server_name idedecms.com idedecms.com www.idedecms.com img.idedecms.mysitecdn.com;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        error_page  503 /errpage/503.html;
        location ~ \.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
        }
        location ~ /\.ht {
                deny  all;
        }
        location / {
                try_files $uri @apache;
        }
        location @apache {
                 proxy_pass http://127.0.0.1:88;
                 include naproxy.conf;
        }
ssl_certificate /www/ssl/idedecms_com/1_www.idedecms.com_bundle.crt;
ssl_certificate_key /www/ssl/idedecms_com/2_www.idedecms.com.key;
ssl_session_timeout 5m;

(把配置文件代码贴出来貌似也无妨,别黑我们服务器哈哈哈哈哈哈哈哈哈哈哈哈)

四,网站页面js,css,以及图片资源引用地址改为https
这个不用我说了吧,网站开启https之后,页面上使用http调用的资源都会无法调用。
你需要把http的资源全都改成https调用。记住,不能漏掉任何一个js引用或者图片
如果有一个文件不是https引用的,则你的网站虽然可以正常https访问,但是地址栏
的https标识不会完全变绿,360浏览器尤为明显。这代表你网站虽然启用了https
但是没有做到完全的规范。被认定为不规范的https页面。

图一,规范的https页面,里面的资源全部使用https调用。
免费空间
图二,不规范的https页面,里面的部分资未使用https调用。
免费空间


相关推荐
免费空间声明:
(一) 由于各方面情况的调整与变化,本网所提供的考试信息仅供参考,敬请以权威部门公布的正式信息为准。
(二) 本网注明来源为其他媒体的稿件均为转载稿,免费转载出于非商业性学习目的,版权归原作者所有。如有内容、版权等问题请在30日内与本网联系。联系方式:邮件 jiansou123@126.com
最近更新
-->
网站地图 | XML地图 | 手机版
版权所有 © 2005-2022 www.128sj.com 免费空间 All Rights Reserved
本网站所有信息全是来源于互联网,如有侵权请来电咨询! 粤ICP备16040413号-1