Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

Magnus Rahl
Nov 4, 2010
  8551
(0 votes)

Running EPiServer CMS in IIS Express

Introducing IIS Express

This summer Microsoft released their WebMatrix platform. WebMatrix is intended as a getting started-kit for web development, containing SQL Server Express, Visual Web Developer Express, a number of example projects and snippets (and online access to more) and a web server: IIS Express.

IIS Express is built on the same core as IIS 7 but is designed to run in a stand-alone process in the current user’s context. This gives developers some new options:

  • Devs still stuck with Windows XP or Server 2003 can get an IIS 7 compatible web server running on their machines.
  • If you don’t want to run your sites in the local IIS when debugging from Visual Studio, you should be able to use IIS Express rather than the ASP.NET Development server and get the full IIS 7 feature set.

For more information on IIS Express, check out Scott Gu’s blog post

The Scenario

The reason I started exploring IIS express was that I wanted to run a dev/test site at home, on my home server. That machine is currently running Windows XP while my dev laptop is Windows 7. To avoid the hassle of double config sections I wanted to run IIS 7 on both machines. IIS Express fixes this.

Installing IIS Express

As mentioned, IIS Express is part of the WebMatrix bundle. So you have to download the WebMatrix installer, but you can then customize the install to include only the parts you need. IIS Express is part of the base set so at first I was trying to find it among the install options but I didn’t. It seems it’s always installed, but you don’t have to install Visual Web Developer etc. unless you want to.

Setting up a site in IIS Express

You can’t use EPiServer Deployment Center to install a site in IIS Express since it’s not run as a service. So there’s no (easy) way to install a new site on the machine running IIS Express.

When launching WebMatrix there is instead an option to create a site from a folder. So if you have installed the EPiServer site on another machine (in my case the dev laptop) you can just publish your solution to a folder and create a site from it in WebMatrix.

Running sites in IIS Express

WebMatrix is then the launch pad for your sites where you set their URL, port and start/stop the sites. It is however possible to launch IIS Express from a command prompt. It’s located in your Progam Files folder under Microsoft Web Matrix and is called iisexpress.exe.

Your site definitions will be stored in an xml file called applicationhost.config in a folder called IISExpress under the current user accounts Documents folder. This file will be used when launching iisexpress.exe and the first site defined (it seems) will be launched.

Using switches it is possible to set what site should be started and even which .config file should be used. So you can store the applicationhost.config in a central location away from the user settings folder if you like:

iisexpress /config:c:\myconfig\applicationhost.config /site:Website1

You can even start a site directly from the folder where it’s stored:

iisexpress /path:c:\myapp\ /port:80

Hosting a site using IIS Express

IIS isn’t intended for hosting. But since it can be started as a console app there’s at least a possibility to start it as a scheduled task when the computer starts up or to run it as a windows service using a generic host. But will it work? Out of curiosity I had to try and yes it will! With some limitations of course.

One limitation is that there is no way to set multiple host headers (at least not that I can find). The site is configured to run under a host/port combination, default to localhost/machine name and port 8080. Set it to use your external domain name and port 80 and it’s ready to go.

I did some basic testing using the free test on LoadImpact. There seems to be no connection limit, at least not up to the 50 connections that the free test uses. It seems to scale rather well in this connection count span, even with my rather weak hardware.

Nov 04, 2010

Comments

Nov 4, 2010 04:39 PM

Nice write up. :)

Please login to comment.
Latest blogs
Azure AI Language – Extractive Summarisation in Optimizely CMS

In this article, I demonstrate how extractive summarisation, provided by the Azure AI Language platform, can be leveraged to produce a set of summa...

Anil Patel | Apr 26, 2024 | Syndicated blog

Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024