SharePoint 2013 Configure an environment for apps Quick Guide

Configure App Management Service Instance and Service Application

purchase a domain name from a domain name provider for your apps, for example, ContosoApps.com
create a forward lookup zone for the app domain name (ContosoApps.com)
create a wildcard Alias (CNAME) record for the new domain name (*.ContosoApps.com -> Portal.contoso.com)
create a wildcard SSL certificate for app domain (*.ContosoApps.com)

Start App Management and Microsoft SharePoint Foundation Subscription Settings services.

Configure App Management Service Instance and Service Application

purchase a domain name from a domain name provider for your apps, for example, ContosoApps.com
create a forward lookup zone for the app domain name (ContosoApps.com)
create a wildcard Alias (CNAME) record for the new domain name (*.ContosoApps.com -> Portal.contoso.com)
create a wildcard SSL certificate for app domain (*.ContosoApps.com)

Start App Management and Microsoft SharePoint Foundation Subscription Settings services.

$account = Get-SPManagedAccount "domain\SrvAcc"
$sssdbname = "SP15_Test_SubscriptionSettingsService"
$appsvcdbname = "SP15_Test_AppManagementService"
# SubscriptionSettingsServiceApplication
$appPoolSubSvc = New-SPServiceApplicationPool -Name SubscriptionSettingsServiceAppPool -Account $account
$appSubSvc = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPoolSubSvc -Name SubscriptionSettingsServiceApp -DatabaseName $sssdbname
$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $appSubSvc
#  App Management service
$appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppManagementService -DatabaseName $appsvcdbname
$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc