One of the feature updates of the March 2013 Public Update for SharePoint 2013 enables you to use multiple app domains in SharePoint 2013 environments with alternate access mapping or host-header web application configurations.
In order to work with these apps, you need to configure the app domain, which is a cornerstone to have apps working. In some cases, you will need to have more than one app domain configured, and I'll explain how in a few lines.
Why do we need multiple app domains?
- You could use app domain on alternate access mappings or host-header web application configurations.
- You can configure an app domain for each web application zone and use alternate access mapping and host-header web application configuration.
- If the web applications cannot have the same application pool identity and authentication scheme.
Steps to configure multiple app domain
Follow the below steps to create another app domain for a specific web application, taking into account that you already have an app domain and this is a new one for your host header web application.
- Configure the first app domain: refer to the References links below to configure it if you don’t have existing app domain.
- Open SharePoint Shell as administrator and run the following commands:
$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService.SupportMultipleAppDomains = $true
- Then reset IIS.
- Create a Forward Lookup Zone in DNS for another app domain (testdomain.mycompany.com). Make sure this is a new domain and different from any other domain you created before.
- Then run this command:
New-SPWebApplicationAppDomain –AppDomain “testdomain.mycompany.com” –port 81 –WebApplication http://testsite.companydomain.com
- Then reset IIS.
Note: you need to use a port that has not been used before.
- You cannot use IIS ports that are already being used when you configure app domains.
- If the app domain is configured to use secure sockets layer (SSL), you must configure the app domain to use a wildcard certificate and bind the SSL to a different port from the web application SSL port.
Overall, apps are an important and interesting topic and it is the future for developing and extending functionality of SharePoint and Office 365. It differs from case to case if you need to have one app domain on your on-premise environment or more than one app domain per the design notes and benefits I presented, but I recommend that if you can, utilize one app domain and share it across all web applications. But if you have design constraints, then you can add multiple web app domains, but know that this will increase the operations effort for configuration and maintenance.