Delphi用App Server和IIS等Web Server共享Http(s)的SSL Path、Method、File

目录

 

Delphi用App Server和IIS等Web Server共享Http(s)的SSL Path、Method、File

一、原理

二、IIS访问https静态文件

    2.1、文件的物理存取路径:

    2.2、文件的物理存取路径:

    2.3、文件的物理存取路径:

三、你编程写的Rest Server访问http静态文件(8085端口)

    3.1、文件的物理存取路径:

    3.2、文件的物理存取路径:

四、你的Rest Server访问Https静态文件(8086端口):

    4.1、文件的物理存取路径:

    4.2、Http(s)逻辑访问路径:

五、案例:

本博客关联:


 

Delphi用App Server和IIS等Web Server共享Http(s)的SSL Path、Method、File

 

    群里最近有同行问到这个问题,归纳整理如下,供大家参考:

    先看两个个访问案例:

    https://www.cpuofbs.com/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/pulledup_privacy20201020.html

    http://www.cpuofbs.com/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/pulledup_privacy20201020.html

    为了达到类似这样的目的,首先你得去证书颁发机构,成功申请SSL证书(方法略,自己参考云服务器提供商官网中关于SSL的服务说明)。

一、原理


    1、SSL的证书申请过程中,需要你按照证书颁发机构的要求设定证书的验证方法路径及其下的文件,比如下面的不可访问的Windows路径.well-known
    2、SSL的证书验证路径:C:\inetpub\wwwroot\.well-known  ,意思就是:https的根路径在:C:\inetpub\wwwroot,在此路径下才能识别SSL证书及https
    3、默认设置的Https的443端口指向及IIS设置的Https重定向路径根:C:\inetpub\wwwroot  

    4、IIS服务器与PulledupIntraweb服务器的根路径
        IIS的根(IIS内部默认指向的路径,但你可以通过设置改变它):C:\inetpub\wwwroot
            IIS可执行主程序并未安装于此,这个是IIS内部的逻辑路径
            IIS实际物理安装路径:C:\Windows\system32\inetsrv
            IIS7.0可执行主程序路径:C:\Windows\system32\inetsrv\InetMgr.exe ,其DLL动态库也在此。           
            IIS6.0可执行主程序路径:C:\Windows\system32\inetsrv\InetMgr6.exe ,其DLL动态库也在此。   
            同理,Apache服务器也类似,只是其配置SSL的方法和指令代码不同
        GYIntrawebRestServer.exe的根:C:\inetpub\wwwroot\app\PulledupIntraweb\Intraweb_rest_Server_CarveoutAppID\wwwroot
        GYIntrawebRestServer.exe的安装路径:C:\inetpub\wwwroot\app\PulledupIntraweb\Intraweb_rest_Server_CarveoutAppID

二、IIS访问https静态文件

    默认443端口,也可不带IIS会因你设置了重定向自动指向443端口。


    2.1、文件的物理存取路径:

        C:\inetpub\wwwroot\app\PulledupIntraweb\Intraweb_rest_Server_CarveoutAppID\wwwroot\image\a.jpg

        Http(s)逻辑访问路径:

        http://www.cpuofbs.com/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/image/a.jpg
        https://www.cpuofbs.com/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/image/a.jpg
        https://www.cpuofbs.com:443/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/image/a.jpg

    2.2、文件的物理存取路径:

        C:\inetpub\wwwroot\app\PulledupIntraweb\Intraweb_rest_Server_CarveoutAppID\wwwroot\nosessionhtmls\image\a.jpg

        Http(s)逻辑访问路径:

        https://www.cpuofbs.com/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/image/a.jpg
        https://www.cpuofbs.com:443/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/image/a.jpg


    2.3、文件的物理存取路径:

        C:\inetpub\wwwroot\index.html

        Http(s)逻辑访问路径:

        https://www.cpuofbs.com/index.html

三、你编程写的Rest Server访问http静态文件(8085端口)
 

    3.1、文件的物理存取路径:

      C:\inetpub\wwwroot\app\PulledupIntraweb\Intraweb_rest_Server_CarveoutAppID\wwwroot\nosessionhtmls\image\a.jpg

        Http(s)逻辑访问路径:

        http://www.cpuofbs.com:8085/nosessionhtmls/image/a.jpg
        

    3.2、文件的物理存取路径:

      C:\inetpub\wwwroot\app\PulledupIntraweb\Intraweb_rest_Server_CarveoutAppID\wwwroot\main.html

        Http(s)逻辑访问路径:

        http://www.cpuofbs.com:8085/nosessionhtmls/main.html

 

       https://www.cpuofbs.com:443/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/image/a.jpg               --------IIS

              等价于:

       http://www.cpuofbs.com:8085/nosessionhtmls/image/a.jpg            --------- App三层Web服务

四、你的Rest Server访问Https静态文件(8086端口):


    4.1、文件的物理存取路径:

        C:\inetpub\wwwroot\app\PulledupIntraweb\Intraweb_rest_Server_CarveoutAppID\wwwroot\image\a.jpg

    4.2、Http(s)逻辑访问路径:

        https://www.cpuofbs.com:8086/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/image/a.jpg  ,再如:

        https://www.cpuofbs.com:8086/GYAPI/getdata?姓名=刘神仙&手机号=18609293820
        https://www.cpuofbs.com:8086/GYAPI/getdata?xm=刘神仙&sjh=18609293820

https://www.cpuofbs.com:8086/GYAPI/getdata?姓名=刘神仙&手机号=18609293820

             //:xm、sjh;姓名、手机号:为相应数据库表中的字段名;GYAPI为三层服务器的API的URI路径,执行后返回如下结果(服务函数getdata:要求了签名): 

        {"code":-1,"msg":"请指定appid姓名=刘神仙&手机号=18609293820"}        

https://www.cpuofbs.com:8086/GYAPI/cx_dwry?xm=刘神仙&sjh=18609293820&page=1

             //:xm、sjh;姓名、手机号:为相应数据库表中的字段名;GYAPI为三层服务器的API的URI路径,执行后返回如下结果(服务函数cx_dwry:要求了签名): 

         {"code":-1,"msg":"请指定appidxm=刘神仙&sjh=18609293820&page=1"}

https://www.cpuofbs.com:8086/GYAPI/getservernowtime?

             //:执行后返回如下结果:(服务函数getservernowtime:未要求签名)

         2021-02-21 13:07:17.037

 

五、案例:

//IIS:
http://www.cpuofbs.com/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/image/a.jpg
https://www.cpuofbs.com/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/image/a.jpg
https://www.cpuofbs.com:443/app/PulledupIntraweb/Intraweb_rest_Server_CarveoutAppID/wwwroot/nosessionhtmls/image/a.jpg


//Rest Server静态文件:
https://www.cpuofbs.com:8086/wwwroot/nosessionhtmls/image/a.jpg
http://www.cpuofbs.com:8085/nosessionhtmls/image/a.jpg
http://www.cpuofbs.com:8085/nosessionhtmls/main.html

//Rest Server的API提供的无需签名验证的函数:
https://www.cpuofbs.com:8086/GYAPI/getservernowtime
http://www.cpuofbs.com:8085/GYAPI/getservernowtime

//Rest Server的API提供的需要签名验证的函数({"code":-1,"msg":"时间戳与标准时间相差不可超过300秒"}):
http://www.cpuofbs.com:8085/GYAPI/cx_dwry?appid=GY000001&sig=56vjb876kjhl&timestamp=158584758454
https://www.cpuofbs.com:8086/GYAPI/cx_dwry?appid=GY000001&sig=56vjb876kjhl&timestamp=158584758454


//Rest Server静态文件SSL 8088端口:
https://www.cpuofbs.com:8088/images/collapse.png
//IIS静态文件80端口:
http://www.cpuofbs.com/app/SSLRestServ/images/collapse.png

 

本博客关联:

     1、《ssl证书绑定windows服务器端口及SSL配置命令详解》 https://blog.youkuaiyun.com/pulledup/article/details/106056206  

     2、《ssl证书绑定端口》https://blog.youkuaiyun.com/pulledup/article/details/107026471

     3、《delphi版HTTP/1. 1 405 Method Not Allowed的终极解释及Http(s)请求的常见错误》https://blog.youkuaiyun.com/pulledup/article/details/107790739

 

喜欢的话,就在下面点个赞、收藏就好了,方便看下次的分享:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

专讲冷知识

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值