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 ASP.NET Core Renderer application. You can use this setup for local development purposes.
PREREQUISITES: You must comply with the following:
- Your Sitefinity CMS application must be hosted on an IIS instance.
For more information, see Run projects on IIS.
- You must have installed Microsoft Visual C++ Redistributable.
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.
- Download the NuGet package Progress.Sitefinity.Cloud.AppGatewayHostRewriteModule.
- Change the file extension from
.nupkg
to .zip and extract the files.
- In the extracted folder, navigate to the
Content
folder.
- Copy the
HostRewriteModule.dll
and paste in a dedicated folder.
NOTE: The folder must to be accessible by the IIS. The file must remain in this folder for as long as the extension is used. Deleting the file or its folder can cause issues.
- Open Internet Information Services (IIS) Manager.
- At the top, select your server and click Modules.
- Click Configure Native Modules » Register.
- Set the name to AppGatewayHostRewriteModule
- In Path, navigate to the
HostRewriteModule.dll
, select it, and click OK.
- Ensure the checkbox next to
AppGatewayHostRewriteModule
is selected and click OK.
- Because both applications are on the same machine, set the Sitefinity CMS binding to
localhost
on port 8080.
- Open the
appSettings.json
of the ASP.NET Core Renderer application.
- In the
Sitefinity
object, add the property "HostHeaderName": "X-Original-Host"
- Update the URL property to mysitefinity.com
- 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.