Orchard CMS测试多站点时IISExpress HOST的配置

本文介绍如何在本地机器上为Orchard CMS配置多租户环境。通过编辑hosts文件和IIS Express配置,实现不同域名映射到同一本地实例的不同站点。特别针对使用WebMatrix和IIS Express的用户。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Testing Multi-Tenancy on a Local Machine

If you are running locally and do not have a domain to map, you can edit your \Windows\System32\drivers\etc\hosts file to create a sample host.

The following advice is for Windows 7 or Windows Vista and was taken from Orchard Issue Tracker on CodePlex). These instructions assume that you're using WebMatrix and IIS Express to work with Orchard.

  1. Open the \Windows\System32\drivers\etc\ folder.

  2. Right-click the hosts file and give yourself modify permissions to that file.

  3. Open the hosts file in a text editor.

  4. Add the following line, replacing mydemo with the domain name you want to use:

    127.0.0.1 mydemo

  5. Open the \Users\\[YourUserName\]\Documents\IISExpress\config\ folder.

  6. Open the Applicationhost.config file in a text editor.

  7. Locate the section for your existing Orchard site, such as the following:

    <site name="mydemo" id="nnnnnnnnn"/>

  8. Under the <bindings> section, leave the default localhost binding, but copy it onto the next line and edit it to read:

    <binding protocol="http" bindingInformation="*:28923:mydemo" />

  9. Substitute the port number above for the one you copied from the default localhost binding.

If you do not want to run WebMatrix with admin privileges (which is not a good practice for security reasons), you need to follow the steps outlined in the article Handling URL Binding Failures in IIS

转载于:https://www.cnblogs.com/robin-z/p/3524942.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值