ISAPI Module is one of the preferred deployment methods which to use for production servers. Configuration of HyperServer in this mode is very similar to Standalone Server mode. Additional to these steps you need to setup IIS and create an Application Pool and an Application Folder. Seting up IIS for HyperServer is similar to steps described under ISAPI Module topic, but there are a few differences:
The standard IUSR built-in account doesn't grant enough privileges to HyperServer application, so we need to change it to LocalSystem or another account with extensive privileges. If you are setting up an existing Pool and want to convert it to HyperServer you need to change the Windows account used for that ISAPI Pool. If you are creating a new Pool then make sure you set its Identity to LocalSystem when creating it.
Please see instructions under Using a Different Account For Application Pool topic on how to change the pool identity.
Important: After changing the Application Pool identity to LocalSystem you should also set your IIS web application authentication method to "Application Pool Identity".
Details about this subject can be found here: Using a Different Account For Application Pool
After changing pool identities you should verify that your Nodes are running under correct user account. This can be done simply by opening the Windows Task Manager. After running your web application In Task Manager try to spot your Node executable processes. By looking at the user name you can check if they are running under correct user account. In below image all Nodes are running under SYSTEM account which shows that we have configured HyperServer ISAPI application correctly.
If your OS is 64-bit and you plan to use 32-bit HyperServer binaries then you need to make sure your pool supports 32-bit DLLs:
After configuring pool you can continue with setting up HyperServer. Please copy file hyper_server.dll to your application folder. This file can be found under ..\uniGUI\HyperServer\bin\
Now you need to rename hyper_server.dll file to any desired name. Preferably the same name as your exiting module. Indeed hyper_server.dll will replace your application DLL and your own application should be recompiled in Standalone Server mode.
Let's demonstrate it by a simple example:
Consider you have an existing uniGUI ISAPI module named myapp.dll. In order to convert it to a HyperServer application follow below steps:
•Configure your existing application pool by changing application pool's identity to LocalSystem and enabling 32-bit applications. You can also create a new Pool if you don't want to change your existing pool.
•Copy hyper_server.dll and hyper_server.cfg files into folder where your existing dll resides. Backup your existing myapp.dll to another folder or rename it to myapp.dll.old.
•Rename hyper_server.dll to myapp.dll and hyper_server.cfg to myapp.cfg.
•Edit myapp.cfg and set binary_name=myapp.exe
•Convert your existing myapp to a Standalone Server. Open your application in Delphi and edit your dpr file, so your application will be compiled into an exe file instead of a dll.
•Copy myapp.exe to same folder as myapp.dll.
•In your browser navigate to your myapp.dll web application. You should be able to see your web application main form (or login form).
It becomes clear that in HyperServer application model your own applications are always deployed in Standalone Server mode. It is the HyperServer itself which takes care of other deployment methods such as Windows Service and ISAPI Module. This makes application development easier. You need to create and test your applications only n EXE format.
Another setting that may affect HyperServer under IIS is Shutdown Time Limit parameter.
This parameter determines the amount of time IIS will wait until ISAPI DLL terminates. HyperServer DLL terminates normally when you recycle or stop the application pool. When terminating a HyperServer instance, it may take longer than normal because HyperServer must terminate all of its Nodes first before it can complete the terminate sequence. Default value is 90 seconds, but you may need to increase the above value to 180 seconds. This value must be enough for HyperServer to terminate all its Nodes when there are many of them. Changing this value is not mandatory. You need to change it only if you think the default 90 seconds value is not enough for your particular application.