1. Thomas Rolseth
  2. PowerServer
  3. Monday, 25 July 2022 18:10 PM UTC

I have a client who will be running several apps in PowerServer 2021 and thus I want to setup IIS with a multiple-site configuration.  To this end, I went through the tutorials in an effort to get this properly configured.  Here is what I've done:

  1. created inbound rule for port 81 on web server running IIS (Windows Server 2016)
  2. configured PowerServer project in client app
  3. CAL installed ok
  4. set web api url on Web APIs tab to https://dev.server.com:81/Testsite (see attached)
  5. Database config (SQL Server) works fine
  6. Deployed PS project with no errors
  7. created second web site called 'Testsite' in IIS and linked it to port 81 (https://docs.appeon.com/ps2021/Creating_an_IIS_website.html).  The root path is C:\inetpub\testsite_root
  8. followed instructions for publishing web api using file system (https://docs.appeon.com/ps2021/Using_the_File_System_method.html) and copied all files to C:\inetpub\testsite_root (see attached)
  9. launchsettings.json has the same url as shown in #4 above (see attached)

When I launch the CAL in my browser, the app starts loading but eventually fails with the CreateSession error -- see attached.  Can someone offer some advice on how to get past this error?  

Thanks, Tom

Attachments (4)
Tracy Huang @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 26 July 2022 01:08 AM UTC
  2. PowerServer
  3. # 1

Hi Thomas,

 

We have a dedicated step-by-step guide for this scenario: Guide 3: Deploying the second app. The screenshots reflect version 2022, but the instructions work for both version 2021 and 2022.

Guide 1 (for deploying to local IIS) and Guide 2 (for deploying to remote IIS) are prerequisites for Guide 3. I would recommend you go through all these three guides.

Regarding error "Session creation failed", there are several possible causes. Please follow these troubleshooting tips: https://docs.appeon.com/ps2022/Session_creation_failed.html

Feel free to let us know whether it is helpful or if you need any further assistance.

 

Regards

Tracy

Comment
  1. Thomas Rolseth
  2. Tuesday, 26 July 2022 20:47 PM UTC
Thanks for this information -- I will definitely go through it all step-by-step. I think the CreateSession error I am getting is because the web api is not starting. I published it to its own web site following the instructions and set the site to use port 81. I created an inbound rule for port 81 in the Windows Firewall and doing a netstat in cmd instance says that port 81 is listening. However, when I telnet the url with port 81 from my laptop it fails. And entering http://dev.server.com:81 in my browser does not bring up the API start page. Is there something else I need to do to make port 81 active?



Tom
  1. Helpful
  1. Tracy Huang @Appeon
  2. Wednesday, 27 July 2022 02:12 AM UTC
Hi Thomas,

A couple of things to check and try:

1) Verify the website's physical path is set to C:\inetpub\testsite_root (per your screenshot).

2) Verify the Web API URL is set to https://dev.server.com:81.

3) Verify your client app is in a different site from the Web APIs (using a different port number and different physical path).

4) Go to the Web APIs folder (C:\inetpub\testsite_root) and start the APIs manually.

You can try to execute the following commands one after another until the Web APIs starts successfully.

ServerAPIs.exe --urls "https://dev.server.com:81"

ServerAPIs.exe --urls "http://localhost:81"

ServerAPIs.exe --urls "http://localhost:8888"

Please try to run the application on your local server if possible, to avoid firewall or network issue.



Regards

Tracy
  1. Helpful
  1. Tracy Huang @Appeon
  2. Wednesday, 27 July 2022 02:52 AM UTC
Hi Thomas,



When you execute netstat -ano | findstr 81, what is the process ID returned? (The last column is the process ID). You can see a more detailed list by executing netstat -bano

In my environment, the process ID returned is 4, and in the task manager PID 4 is a system process called "NT Kernel & System". Could it be possible that 81 is occupied too in your server? Can you modify the IIS website to use a different port number and try again?



Regards

Tracy
  1. Helpful
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Monday, 25 July 2022 18:29 PM UTC
  2. PowerServer
  3. # 2

Hi Thomas,

A few things:

1) The Web API URL on PowerBuilder's PowerServer config should be https://dev.server.com:81/ instead of https://dev.server.com:81/Testsite
2) Did you install the .NET Hosting Bundle? You can download it from here. Once you install it, restart the 'Testsite' site and its application pool.
3) You can use the URL https://dev.server.com:81/health to check whether the Web APIs are alive (they might return "Unhealthy". This is OK)
4) The file launchsettings.json is only used when starting the Web APIs from inside the IDE (PowerBuilder or SnapDevelop). When hosting the APIs on IIS, this file has no effect.

Hope this info helps you solve the issue and let me know if you have any questions.

Regards,
Francisco

Comment
  1. Thomas Rolseth
  2. Monday, 25 July 2022 19:02 PM UTC
Francisco,

1) Before using https://dev.server.com:81/Testsite I tried it with https://dev.server.com:81 but that didn't work either.

2) web hosting bundle has been installed

3) 'unhealthy' was returned when I tried this

4) ok -- makes sense



Tom
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.