【问题标题】:Configuring IIS Express to use default ports for http and https for debugging将 IIS Express 配置为使用 http 和 https 的默认端口进行调试
【发布时间】:2012-04-24 12:53:57
【问题描述】:

我已关注scot's article,了解如何分别为 http 和 https 启用默认端口(80 和 443)。我已经按照每个步骤进行操作,最后 IIS 快速系统托盘向我显示该站点正在以下 url 上运行

我唯一不同的是使用netsh>advfirewall>firewall 上下文,因为它告诉我netsh firewall 已被弃用。我使用以下命令允许端口 80 通过防火墙

netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80 

这里是 IIS Express 的 applicationhost.config 文件中的相关站点部分

<site name="SSLTest" id="4">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="G:\Adeel\SSLTest\SSLTest" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:51518:localhost" />
                    <binding protocol="https" bindingInformation="*:44301:localhost" />
                    <binding protocol="http" bindingInformation="*:80:mhlabs" />
                  <binding protocol="https" bindingInformation="*:443:mhlabs" />
                </bindings>
            </site>

编辑: 问题是当我浏览到 http:/mhlabs 或 https:/mhlabs 时它不起作用。我找不到浏览器的页面。我怎样才能解决这个问题。
Edit2: 好的,作为第一步,我想忘记 ssl,只需在端口 80 上为 test-one 保留一个 url 并在此运行我的网站网址。想到的逻辑步骤是我使用netsh http add urlacl url=http://test-one:80/ user=everyone 保留一个url,并将这个条目添加到applicationhost.config 文件的绑定部分。我还允许端口 80 通过防火墙,但整个事情似乎对我不起作用。有什么想法吗?

【问题讨论】:

  • 我已经关闭了防火墙,但仍然无法通过友好的 URL 访问站点,例如 http://mhlabshttps://mhlabs

标签: asp.net visual-studio-2010 iis ssl iis-express


【解决方案1】:

您是从命令行启动 iis express 还是使用 WebMatrix?

如果您不是从命令行启动它,请尝试以下步骤,看看是否有任何绑定错误。

  1. 启动命令提示符,转到 iis express 安装文件夹 '%programfiles%\iis express'

  2. 运行以下命令

    iisexpress.exe /site:SSLTest

  3. 如果有任何绑定注册失败,您会看到一些错误消息。 如果 'mhlabs' 绑定注册有任何错误,请确保您的 URL 保留是正确的。 URL 保留命令应如下所示

    netsh http 添加 urlacl url=http://mhlabs:80/ user=everyone

【讨论】:

  • iis express 由 vs 2010 自动启动,因为我使用 iis express 进行调试,而不是其内置的开发服务器。
  • 而且我已经使用 netsh http add urlacl 命令保留了 url,如果我尝试再次添加它,它会给出错误提示文件存在或类似。我可以在星期一粘贴确切的细节。
  • 你可以尝试从命令行启动它,看看是否有任何绑定失败错误消息?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-06-14
  • 1970-01-01
  • 2021-02-17
  • 2018-05-05
  • 2017-03-28
相关资源
最近更新 更多