Testing multi-tenancy on a Local machine

Source: Internet
Author: User

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

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

The following advice are for Windows 7 or Windows Vista and were 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 and the mydemo 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 section <bindings> , 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 and copied from the default localhost binding.

If you don't want to run WebMatrix with admin privileges (which are not a good practice for security reasons), you need to Follow the steps outlined in the article handling URL Binding failures in IIS Express as follows:

    1. Open a command window that has administrative privileges. (In all Programs > accessories >Command Prompt, right-click the program shortcut and then Click Run as Administrator.)

    2. Run the following command:
      > netsh http add urlacl url=http://mydemo:28923/ user=everyone
      This can later is removed with the following command:
      > netsh http delete urlacl url=http://mydemo:28923/

Alternatively, you could run WebMatrix using admin privileges as follows:

    • Open WebMatrix with admin privileges. (right-click the shortcut in Windows and then click Run as Administrator.)

Finally:

    1. Open your site and attempt to start it.

    2. Locate the IIS Express icon in the taskbar and right-click it. You see the your site name, where you can select to open it via its additional URL.

Remember to remove the item from the hosts file or comment out of the line using the # character if you want to View the live site from the same domain name after your ' ve deployed it to an ISP. You need to is very careful that is looking at the remote site rather than the local one. Consider adding something to one or other of the themes to make the difference immediately apparent.

Note: Alternatively, instead of editing the hosts file, you can use the URL *.127-0-0-1.org.uk, where * is the Name of your tenant or another name of your choosing. This would loop back to localhost and was sufficient for testing multi-tenancy locally.

Testing multi-tenancy on a Local machine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.