zoukankan      html  css  js  c++  java
  • Multiple HTTPS Bindings IIS 7 Using appcmd

    http://toastergremlin.com/?p=308

    Sometimes when using a wildcard SSL or Unified Communications Certificate (UCC) it is necessary to add multiple https host headers for a single IP. Unfortunately the IIS 7 GUI does not allow you to set a host header on a https binding however this can be achieved using the “appcmd” command.

    1. First bind the certificate to one site as normal by adding the https binding through the IIS GUI.

    2. Open a command prompt and navigate to C:WindowsSystem32Inetsrv using the command below:

    cd C:WindowsSystem32Inetsrv

    3. Enter the following command to manually set the binding bearing in mind the notes below:

    appcmd set site /site.name:"SiteNameInIIS" /+bindings.[protocol='https',bindingInformation='IP.Add.re.ss:443:www.example.com']

    Make sure to change the following values on the command above accordingly:

    SiteNameInIIS: The site name exactly how it appears in IIS. For instance “example.com”.

    IP.Add.re.ss: The IP used by the site.

    www.example.com: The desired hostname. Note in most cases there will be one for www and non-www.

    Example command:

    appcmd set site /site.name:"example.com" /+bindings.[protocol='https',bindingInformation='1.2.3.4:443:www.example.com']

    Running the appcmd command from a batch file:

    To make this process easier you can use the batch file below. This will prompt you for the site name, IP, and host header value and then make the appropriate host header change.

    Save the code as something like “addsslbinding.bat” and then call it from a command prompt by entering the name of the file (ie. “addsslbinding”).


    @echo off
    echo Enter site name in IIS:
    set /p SiteName=
    echo Enter IP address:
    set /p IP=
    echo Enter host header value (ie. www.domain.com):
    set /p HostHeader=
    C:WindowsSystem32Inetsrvappcmd set site /site.name:"%SiteName%" /+bindings.[protocol='https',bindingInformation='%IP%:443:%HostHeader%']

    Example:

  • 相关阅读:
    [LeetCode] 303. 区域和检索
    [LeetCode] 120. 三角形最小路径和 ☆☆☆(动态规划 范例)
    [LeetCode] 18. 四数之和 ☆☆☆(双指针)
    [LeetCode] 16. 最接近的三数之和 ☆☆☆(双指针)
    [LeetCode] 109. 有序链表转换二叉搜索树 ☆☆☆(递归)
    优惠券模块设计要点
    nginx upstream 实现负载均衡
    nginx fastcgi配置
    nginx rewrite规则
    nginx Location 配置
  • 原文地址:https://www.cnblogs.com/luckjun/p/4250199.html
Copyright © 2011-2022 走看看