Configuring SharePoint 2013 Host Named Site Collections and Apps Host

November 22 2012 27 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 http://technet.microsoft.com/en-us/library/fp161230(v=office.15).aspx

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 http://blogs.msdn.com/b/kaevans/archive/2012/03/27/what-every-sharepoint-admin-needs-to-know-about-host-named-site-collections.aspx

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 (http://intranet.sp.dev)
- Apps Catalog site (http://intranet.sp.dev/apps)

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 http://app-GUID.spapps.dev for apps. Note that this is not a subdomain of sp.dev –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 http://technet.microsoft.com/en-us/library/fp161236.aspx. 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. http://blogs.technet.com/b/mpriem/archive/2012/11/07/always-have-a-root-site-collection.aspx).

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 "http://intranet.sp.dev" -OwnerAlias "SP\sp_install" -HostHeaderWebApplication $wa -Name "Intranet" –Template "STS#0"

Now you should be able to open address http://intanet.sp.dev. Let’s next create the apps host site for our intranet. We want to use URL http://intranet.sp.dev/apps 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 "http://intranet.sp.dev/apps" -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 (spapps.dev) and app prefix (app).

You can now test your apps host by navigating to http://app-123456789.spapps.dev . You should get a login prompt.

Then comes the tricky question. What is the best practice for handling these URLs?
You cannot add http://*.spapps.dev 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: 4% [?]

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

  1. Ben Athawes says:

    Hi Marko,

    Cheers for the article.

    I’m fairly sure you could use managed paths with host-named sites in SP2010. See http://technet.microsoft.com/en-us/library/cc424952(v=office.14).aspx#section5

    Ben

  2. Marko Rosberg says:

    That’s absolutely true. Thanks Ben!
    I mixed up 2010 and 2013 in Kirk Evans’ article.

  3. alian says:

    Nice above the picture.are they SharePoint designer?

  4. kourosh says:

    Hi, I followed what you wrote regarding creating host named site collection. I created a web application by your script (only thing I changed I added -url parameter) and create an empty site in CA to the web application root. Now when I browse to the site collection it goes to iis8 default home page (also same as localhost).??

  5. Hi there! This is kind of off topic but I need some advice from an
    established blog. Is it difficult to set up your own blog?

    I’m not very techincal but I can figure things out pretty quick. I’m thinking about
    setting up my own but I’m not sure where to start. Do you have any points or suggestions? Thanks

  6. sandysmith says:

    Great challenges totally, you simply got the logo fresh audience. What might people propose regarding offered you created some days previously? Almost any certain?

  7. Lorie says:

    I constantly emailed this weblog post page to all my associates, as if
    like to read it then my contacts will too.

  8. kourosh – Stop the default IIS website. I had to create a new web application using the machine name WITHOUT a host header on port 80 as a “catch-all” for the apps catalog.
    For some reason I still get prompted to log in, was hoping someone would address this.

  9. Just want to say your article is as astounding. The clarity on your
    publish is simply great and i could assume you’re knowledgeable on this subject. Well along with your permission let me to seize your feed to keep updated with coming near near post. Thanks a million and please carry on the rewarding work.

  10. Hi my friend! I want to say that this post is amazing, nice written and come with approximately all important infos.

    I’d like to see extra posts like this .

  11. My Web Page says:

    Hey there, Cool write-up. There is an difficulty with the web site throughout web browser, might test this particular? Web browser on the other hand is definitely the market primary along with a significant area of other individuals will certainly pass over your current good publishing for this reason challenge.

  12. My brother recommended I might like this website.

    He was entirely right. This post actually made my day.
    You can not imagine just how much time I had spent for this
    info! Thanks!

  13. webs.com says:

    Excellent blog! Do you have any tips and hints for aspiring writers?

    I’m hoping to start my own blog soon but I’m a little lost on everything.
    Would you advise starting with a free platform like WordPress or go for a paid option?
    There are so many options out there that I’m completely confused ..
    Any suggestions? Bless you!

  14. complaints says:

    Howdy! Do you know if they make any plugins to help with Search Engine
    Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not
    seeing very good results. If you know of any please share.
    Cheers!

  15. Thank you a lot for sharing this with all of us you actually know what you’re speaking about!
    Bookmarked. Please also discuss with my site =). We could have
    a hyperlink trade contract between us

  16. I am actually thankful to the holder of this website
    who has shared this enormous post at at this time.

    I’m sure all of you here perform Team Fortress
    two, or else you wouldn’t be right here! I also perform TF2, and one
    thing that I couldn’t get my head all around was accumulating all the products!!
    I’v observed some gamers cant even collect most of
    the objects, in no way brain ALL of them!!
    I was dedicated to getting all the items, but it seemed unattainable, so getting an experienced programmer, I acquired to operate!

    Following hrs of challenging function I designed, what I say one of the
    greatest hacks out there! (biased much?!) The tool that I have produced makes
    it possible for you to unlock any of the objects you would like in TF2!

    I’ts basic genuinely…
    I was preparing to offer this tool and permit some money start rolling in, but i know the experience of not getting capable to pay for it, or being a ‘poor’ man on TF2, so I have decided to give
    this out for cost-free to see what individuals consider of it!
    Just study the tutorial beneath detailing how to acquire and use
    the device!

  17. You are so awesome! I do not suppose I’ve truly read through a single thing like that before.
    So wonderful to find someone with some unique thoughts
    on this subject. Really.. many thanks for starting this up.
    This site is one thing that is needed on the internet, someone with some originality!

  18. Howdy! Do you use Twitter? I’d like to follow you if that would be okay.
    I’m undoubtedly enjoying your blog and look forward to new posts.

  19. Such a outstanding chart. In spite of the top attempts of
    the Entire world Financial institution the 12-monthly armed forces finances features constantly depended upon Miley
    Cyrus naked to some degree, but now additional which ever before.
    Inside lighting of the cost-free buy and sell must be reviewed.
    Machiavellian nation-wide politics is rife. Are usually each of
    our management normal within subsequent and also retaining politics electric
    power? Researching intercontinental relations since the stop of the
    one hundred year is usually like observing Miley Cyrus naked now, and comparative in the 1800s.

    Here is my weblog; miley cyrus nude

  20. Great beat ! I wish to apprentice while you amend your web site, how could i subscribe for a blog site? The account helped me a acceptable deal. I have been a little bit familiar of this your broadcast provided vibrant transparent concept

  21. We are a group a group of volunteers and starting a brand new scheme in our community.

    Your web site provided us with valuable and work on .
    You made ​​an impressive task and our all
    the community will thankful to you .
    Unquestionably believe that you said . Your favorite justification seemed to be
    on the web easy factor to have in mind of
    . I tell you , i definitely annoyed people think concerns
    not realize about . You controlled and also out everything managed to hit the nail on the top without having side effect , other folks could
    take a signal. Will probably be back to get more.
    Thanks

    my page … real racing 3 hack

  22. Hi, i think that i saw you visited my weblog so i came to “return the favor”.I
    am trying to find things to enhance my web site!I suppose its ok to use
    some of your ideas!!

    Also visit my web site :: Cookie Clicker Hack

  23. Highly descriptive blog, I loved that bit. Will there be a part 2?

    Review my blog :: Words With Friends Cheats

  24. rea says:

    Thank yoou for sharing your thoughts. I truly appreciate
    your effotts and I will be waiting for your next write ups
    thanks onc again.

  25. It’s going to be end of mine day, but before ending I am reading this enormous article to increase my know-how.

    My webpage: Call Of Duty Advance Warfare Hack

  26. Domki Jurata says:

    For latest news you have to pay a quick visit web and
    on the web I found this web page as a best site for hottest updates.

    Here is my web site … Domki Jurata

Leave a Reply