Host Sitefinity CMS on a separate IIS server for local development

Overview

This article explains how to host Sitefinity CMS on an IIS instance and make it accessible to the .Net Core Renderer application. You can use this setup for local development purposes.

PREREQUISITES: You must have hosted your Sitefinity CMS application on an IIS instance. For more information, see Run projects on IIS.

After you have hosted your Sitefinity CMS on an IIS, depending on the port setup, you can do the following:

Scenario 1: Sitefinity CMS listens to unique port

When Sitefinity CMS is the only running application that listens to a specific port, such as 80 or 433, you can configure the Renderer application in one of the following ways:

  • In the appsettings.json file of the Renderer, modify the URL to be the IP address of the machine that hosts the Sitefinity CMS.
  • Add a binding in your hosts file that has a custom domain pointing to the IP address of the machine that hosts the Sitefinity CMS. Afterwards, use this binding in the appsettings.json file of the Renderer application.

Scenario 2: Sitefinity CMS shares a port

When Sitefinity CMS is hosted alongside other applications on the same port, the applications are differentiated by their domain names.

NOTE: The following procedure assume that Sitefinity CMS is hosted with domain name mysitefinity.com, under the default ports – 80 and 443.

  1. Open the web.config file of your Sitefinity CMS.
  2. Inside the <system.webServer> config element, add the following rewrite rule:
  3. Save and close the web.config.
  4. In the IIS, allow the HTTP_HOST server variable on the Sitefinity CMS application in the following way:
    1. In the Sites dropdown, select the Sitefinity CMS application.
    2. Under HTTP Features, click URL Rewrite.
    3. In the right sidebar, click View Server Variables » Add.
    4. For the name of the variable, enter HTTP_HOST and click OK.
      It appears in the list of allowed variables with Entry Type set to Local.
  5. Open the appSettings.json of the .NET Core Renderer application.
  6. In the Sitefinity object, add the property "HostHeaderName": "X-Original-Host"
  7. Update the URL property to mysitefinity.com
  8. Save and close the appSettings.json.

NOTE: You can add a binding in your hosts file to the same domain - mysitefinity.com.
The binding must point to the IP Address of your IIS instance. Then, you use that binding in the appsettings.json file of the Renderer.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?