In this guide, we will host the client app and the PowerServer Web APIs under the same IIS server; for clarity, we will create two IIS websites: one for hosting the client app and the other for hosting the Web APIs.
Note
Be aware of the following when hosting the application under IIS:
-
Do not use any website that is already hosting applications or pages for hosting the client app or Web APIs. It is highly recommended that you create a new site and make sure the site contains the client app or Web APIs only (no other apps or pages).
-
If you have multiple Web APIs, you can deploy each Web APIs to a separate IIS website or deploy multiple Web APIs to different sub-folders of the same IIS website.
For new users or for those who are setting up a test or development environment, deploying each Web APIs to a separate IIS website is recommended, because it is easier to configure and succeed.
For experienced users or for those who are setting up a production environment, deploying multiple Web APIs to different sub-folders of the same IIS website is recommended, because it is easier to manage multiple Web APIs, but you will have to convert the sub-folder to an IIS sub-application first (see Deploying multiple Web APIs to IIS).
-
If you have multiple client apps, you can deploy multiple client apps to the different sub-folders of the same IIS website. You don't need to convert the sub-folder to application (like Web APIs). You only need to deploy or copy the client app files to the sub-folder and then include the sub-folder in the URL when accessing the client app.
Step 1: In Server Manager, click the Tools menu and then select Internet Information Services (IIS) Manager.
Step 2: In IIS Manager, open the server's node in the Connections panel, right-click the Sites folder, and then select Add Website.
Step 3: Specify the following values and then click OK to create the first site.
-
Site name: clientapp in this example
-
Physical path: C:\inetpub\wwwroot\clientapp in this example. This is where the client app will be published.
-
Port: 81 in this example.
The IIS website is created and started.
Step 4: Repeat the above steps to create the second website (suppose using the following settings).
-
Site name: webapis in this example
-
Physical path: C:\inetpub\wwwroot\webapis in this example. This is where the Web APIs will be published.
-
Port: 82 in this example.