Kentico CMS 6.0 Windows Azure Deployment Guide

Running multiple instances in one Web role

Running multiple instances in one Web role

Previous topic Next topic Mail us feedback on this topic!  

Running multiple instances in one Web role

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Kentico CMS allows you to run more than one web project instance in a single Azure Web role. To enable this functionality, you only need to make a few adjustments to the service definition file. This topic describes the steps you need to take in order to add another website project to your Azure application.

 

1. Add another site to the <Sites> section of your service definition file, as highlighted in the following code example.

 

<Sites>

 <Site name="Web">

   <Bindings>

     <Binding name="HttpIn" endpointName="HttpIn" />

   </Bindings>

 </Site>

 

 <Site name="Web2" physicalDirectory="c:\inetpub\wwwroot\KenticoCMS_SecondSite">

   <Bindings>

     <Binding name="HttpIn" endpointName="HttpIn" hostHeader="www.example.com" />

   </Bindings>

 </Site>

</Sites>

 

2. Set the physicalDirectory parameter to the path to the directory where you have your second website project installed. You don't need to provide this parameter to the first site, because its default name "Web" instructs Visual Studio that the site definition is referring to the Web role project.

 

3. Specify a hostHeader for the second site. Similarly to IIS, two sites cannot listen on the same port without having a host header specified.

 

Running on an emulator

 

If you want the two sites to run on your local machine using the emulator, you will need to take the following additional steps:

 

1. Edit the hosts file from the following directory: <%SYSTEMROOT%>\System32\drivers\etc\.

 

2. Add mappings of your local IP address to host names, which you specified for sites in the service definition file. In the case of the provided example code, you would add the following line at the end of the file:

 

127.0.0.1 www.example.com

 

Deploying to the cloud

 

There's no difference between deploying a standard application and deploying an application that runs more Kentico CMS instances in a Web role. To deploy your application, follow the steps described in the Deployment to the cloud topic.