Switching App Domains

This topic describes how to change the domain of an existing Pivotal Platform installation, using an example domain change from yourapps.mydomain.com to newapps.mydomain.com.

  1. In the Ops Manager Installation Dashboard, select the Pivotal Application Service (PAS) tile.

  2. Select Domains from the menu to see the current Apps domain for your PAS deployment. In the following example, it is yourapps.yourdomain.com.

    The page header says 'Domains'. Below this header is the text 'For help configuring these fields, see the Configure Domains section of the Configuring PAS topic in the PCF documentation,' with 'Configure Domain' in blue letters to denote a clickable link. Below this text are two fields labeled 'System domain' and 'Apps domain', with red asterisks to denote that they are required fields. The 'System domain' field contains the text 'yoursystem.yourdomain.com'. The 'Apps domain' field contains the text 'yourapps.yourdomain.com'. At the bottom of the image is a rectangular blue button labeled 'Save'.

  3. In the terminal, run cf login -a YOUR_API_ENDPOINT. The cf CLI prompts you for your Pivotal Platform username and password, as well as the org and space you want to access. If you do not know your API endpoint, see Identifying the API Endpoint for Your PAS Instance.

  4. Run cf domains to view the domains in the space. If you have more than one shared domain, ensure that the domain you want to change is at the top of the list before you apply the new domain to your PAS tile configuration. You can delete and re-create the other shared domains as necessary to push the domain you want to change to the top of the list. If you do this, make sure to re-map the routes for each domain. For more information, see Configuring Routes and Domains.

        $ cf domains
        Getting domains in org your-org as admin...
    
        name                  status
        yourapps.yourdomain.com   shared
    
  5. Run cf routes to confirm that your apps are assigned to the domain you plan to change:

        $ cf routes
        Getting routes as admin ...
    
        space      host    domain                apps
        your-space yourapp yourapps.yourdomain.com yourapp
    
  6. Run cf create-shared-domain YOUR_DESIRED_NEW_DOMAIN to create the new domain you want to use:

        $ cf create-shared-domain newapps.yourdomain.com
    
        Creating shared domain newapps.yourdomain.com as admin...
        OK
    
  7. Run cf map-route APP_NAME NEW_DOMAIN -n HOST_NAME to map the new domain to your app. In this example, both the NEW_DOMAIN and HOST_NAME arguments are yourapp, since this is both the name of the app to which you are mapping a route and the intended hostname for the URL.

        $ cf map-route yourapp newapps.yourdomain.com -n yourapp
    
        Creating route yourapp.newapps.yourdomain.com for org your-org / space your-space as admin...
        OK
        Adding route yourapp.newapps.yourdomain.com to app yourapp in org your-org / space your-space as admin...
        OK
    
  8. Repeat the previous step for each app in this space. Afterwards, check Apps Manager to confirm that the route URL has updated correctly for each app:

  9. Repeat the above steps for each space in your Pivotal Platform installation except for the System org, beginning with logging into the org and space and ending with confirming the URL update.

    Note: Ordinarily the System org contains only Pivotal Platform apps that perform utility functions for your installation. Pivotal does not recommend pushing apps to this org. However, if you have pushed apps to System, you must also repeat the above steps for these apps.

  10. Once you have confirmed that every app in every space has been mapped to the new domain, delete the old domain by running cf delete-shared-domain OLD_DOMAIN_TO_DELETE:

        $ cf delete-shared-domain yourapps.yourdomain.com
        Deleting domain yourapps.yourdomain.com as admin...
    
        This domain is shared across all orgs.
        Deleting it will remove all associated routes, and will make any app with this domain unreachable.
        Are you sure you want to delete the domain yourapps.yourdomain.com?
        > yes
        OK
    
  11. Configure your PAS tile to use the new domain, and apply the changes. Apps that you push after your update finishes use this new domain.

    The page header says 'Domains'. Below this header is the text 'For help configuring these fields, see the Configure Domains section of the Configuring PAS topic in the PCF documentation,' with 'Configure Domain' in blue letters to denote a clickable link. Below this text are two fields labeled 'System domain' and 'Apps domain', with red asterisks to denote that they are required fields. The 'System domain' field contains the text 'yoursystem.yourdomain.com'. The 'Apps domain' field contains the text 'newapps.yourdomain.com'. At the bottom of the image is a rectangular blue button labeled 'Save'.