【问题标题】:How can I remote test an Orchard tenant running on local IIS?如何远程测试在本地 IIS 上运行的 Orchard 租户?
【发布时间】:2017-06-23 17:58:42
【问题描述】:

我使用 Visual Studio 2013 和 IIS 10。

通常当我在开发 Orchard 网站时,我会通过在我的 Windows 主机文件中添加一个别名然后在 IIS 中为该别名添加一个绑定来在本地对其进行测试,例如

主持人:

127.0.0.1 mysite

IIS:

Type     | Hostname    | Port   
------------------------------
http       mysite        80 

当我想在不同的设备上进行测试时,我会在 IIS 中为网站添加一个任意端口的绑定,例如 666,而无需指定主机名。然后我打开该端口,这样我就可以通过本地网络上的手机或平板电脑浏览到http://mycomputer:666 来访问它。或者,如果我想将其展示给其他人,我可以使用 ngrok 获取该端口的临时公共 URL。

但是我怎样才能获得一个端口来将我带到在同一网站下运行的租户呢?

主持人:

127.0.0.1 mysite
127.0.0.1 mytenant

IIS:

Type     | Hostname    | Port   
------------------------------
http       mysite        80     // I can reach the master locally at http://mysite
http       mytenant      80     // I can reach the tenant locally at http://mytenant

http                     666    // mycomputer:666 takes me to mysite
                                // How to get it to take me to mytenant?

http       mytenant      666    // This doesn't work, invalid hostname error

【问题讨论】:

    标签: iis orchardcms


    【解决方案1】:

    您可以在您的主机中拥有 127.0.0.1 local.site.com & 127.0.0.1 local.tenant.com 然后在 IIS 中将主机名设置为local.tenant.com at xxx port

    【讨论】:

    • 如果我这样做,我可以访问 local.site.com 和 local.tenant.com:xxx,但只需访问 local.tenant.com 只会显示默认 IIS 页面并尝试通过 mycomputer:xxx 访问它仍然给我一个无效主机名错误。这可能是我的配置有问题吗?
    • 我意识到我可以通过指定像 /tenant 这样的 URL 前缀来测试租户,然后我可以通过 mycomputer:xxx/tenant 访问它。这足以满足我目前的要求,但我会继续尝试让单独的主机正常工作。
    • local.tenant.com 您需要在 80 端口上进行新绑定
    猜你喜欢
    • 2011-11-24
    • 1970-01-01
    • 2012-04-24
    • 1970-01-01
    • 1970-01-01
    • 2015-02-24
    • 1970-01-01
    • 2014-04-14
    • 1970-01-01
    相关资源
    最近更新 更多