Configuring SharePoint 2013 Host Named Site Collections and Apps Host

November 22 2012 101 comments

There are a few good articles about configuring Sharepoint 2013 apps host, but atleast I found it somehow difficult to figure out how for example Intranet web application and application host could be configured. For beginning you should read this article

The key to get apps host working is host named site collection (HNSC). Most of us have used host named web applications, but quite a few are familiar with host named site collections. Host named site collections are part of tenant technology and you can read more about it in Kirk Evans MSDN blog article

I will first explain what we are going to do. The idea is to create web application that will host two site collections:
- Intranet site (
- Apps Catalog site (

In SharePoint 2010 this wouldn’t have been possible since you couldn’t use managed paths with host named site collections. This is one of the improvements in 2013 and hence it’s now possible to use managed paths with HNSC.

Based on the technet article we are going to use url for apps. Note that this is not a subdomain of –domain.
The first thing to do is to add DNS-records for intranet and apps. You can do this by following the steps listed in the following article You should also start following services in Central Admin:
- App Management Service
- Microsoft SharePoint Foundation Subscription Settings Service

We are not going to take a look at these steps in more detail because there’s already tens of articles explaining how to do that.

Next we are going create a new host web application for site collections. This is done by PowerShell (note that managed account sp_app has to be added already):

$ap = New-SPAuthenticationProvider
$wa = New-SPWebApplication -DatabaseName "SharePoint_Content_Intranet" –ApplicationPool "Intranet" -Name "Intranet" -Port 80 -ApplicationPoolAccount (Get-SPManagedAccount "sp\sp_app") -AuthenticationProvider $ap

This will create an empty web application that will be using servers name as address. Next you have to create an empty site in CA to the web application root. I got a lot of critical events to the event log when it was missing. Also other users have reported issues if it’s missing (i.e.

After that we will add intranet site collection. We will be using team site as site collection template (STS#0). You can get all templates by using Get-SPWebTemplate command.

New-SPSite "" -OwnerAlias "SP\sp_install" -HostHeaderWebApplication $wa -Name "Intranet" –Template "STS#0"

Now you should be able to open address Let’s next create the apps host site for our intranet. We want to use URL thus we need to add a new managed path. SharePoint 2013 supports managed paths with host HNSC (SharePoint 2010 did also). A new managed path to be used with HNSC can be added by using PowerShell:

New-SPManagedPath -RelativeURL "apps" -HostHeader –Explicit

Let’s now add the App Catalog Site: APPCATALOG#0

New-SPSite "" -OwnerAlias “SP\sp_install" -HostHeaderWebApplication $wa -Name "Application Catalog" -Template “APPCATALOG#0”

After that we have to configure apps. This can be done in Central Admin Apps section. Click Manage App Catalog.

Apps section in CA

Select the right web application from top right corner and select Enter a URL for an existing app catalog site. Insert your app catalog address.

After that configure App URLs from Apps section.
Insert your app domain ( and app prefix (app).

You can now test your apps host by navigating to . You should get a login prompt.

Then comes the tricky question. What is the best practice for handling these URLs?
You cannot add http://* to trusted sites or local intranet zone because it would compromise your security with certain browsers (), but I’m sure your users will be not happy with constant login prompts when they navigate to sites using apps. If you have an opinion about this, please leave a comment.

Note that if you want to crawl HNSCs you just add your web applications address to the search content source (not individual site collection addresses).

Popularity: 35% [?]

101 comments to “Configuring SharePoint 2013 Host Named Site Collections and Apps Host”

  1. Bryan says:

    The procedure entails taking down the tree and grinding away at the stump. Specialized tools like chippers, cranes, and chainsaws are needed, as well as skilled workers like the Christchurch Arborist team, join us!

Leave a Reply