Setting up your farm for SharePoint hosted up might be trivial but it can be rather complex when you have multiple web applications in your farm which are using the same IP and maybe also share the same SSL SAN certificate.
In this scenary you need to
- add your app-hosting domain to the SAN certificate (i.e. *.apps.company.com)
- create a new SharePoint web app using a dedicated public URL (i.e. shpapps.company.com) but no host header
- in IIS settings make sure that all web apps for regular SharePoint content are configured to use Server Name Indication (Checkbox is labelled „Require Server Name Indication“) and have the public URL also defined as host name
- in IIS settings make sure that your web app for app hosting is configured without host name and Server Name Indication is not checked
- in IIS settings make sure that your SAN certificate is associated with each web application (including regular content as well as app hosting)
- In DNS create a host name (A RECORD) – in this example shpapps.company.com which resolves to your (V)IP address of your farm
- in DNS create a subdomain – in this example apps.company.com. In this sub domain create a CNAME entry which targets the A RECORD from step 6 – in this example shpapps.company.com
- If not yet done register your app domain in SharePoint (i.e. apps.company.com) and register your app-prefix (i.e. apps)
- create an app catalog – simply create a new site collection using the APPCATALOG#0 template
- associate the app catalog create in step 9 with the regular web application you want to use apps in – i.e. with powershell command Update-SPAppCatalogConfiguration -Site
To verify everything is configured correctly aquire a simple SharePoint hosted app – i.e. a HelloWorld app – and upload it to your app catalog. Create a test site collection and add the app to your site. Wait a little bit until the app (and the app web hosting the app) was added to your site collection and click the app tile in your site. You should be redirected to your app web and the contents of the app should be displayed (i.e. Hello World).