RAD Server Lite Deployment

From RAD Studio
Jump to: navigation, search

RAD Server requires a backend database, based on InterBase, and it is generally deployed as a web server DLL module for either IIS or Apache. For this reason, a standard deployment requires:

  • The web server and its configuration of the RAD Server module
  • The RAD Server deployment and configuration
  • An installation of InterBase with a special purpose RAD Server license (a license the user needs to register on the target device to activate)

For development, we have long offered a stand alone version of RAD Server, based on the Indy HTTP server, which offers limited performance but much easier deployment and the ability to be executed under the debugger (so you can debug your RAD Server modules code). The development version is not meant, and it’s not licensed for deployment. It has a limit in the number of users you can create, and it can work with a local InterBase Developer edition (the license for it is part of the RAD Studio license).

RAD Server Lite (RSLite) offers a simpler deployment model for test servers and scenarios not requiring a lot of throughputs, and it offers this by using the InterBase embedded database engine, IBToGo, instead of the full-blown server and combines it with a simplified licensing model.

RSLite uses the same binary of the development edition (that ships with RAD Studio) along with IBToGo binaries and a license slip file you can deploy with your solution (requiring no registration on the computer you deploy it to). Because it uses an embedded database and because it uses the Indy HTTP Server component, it cannot serve the same number of requests per second of a regular full-blown RAD Server installation, and it cannot scale with multiple RAD Server front ends.

The underlying architecture used by RSLite has much more limited scalability, but we expect it to be sufficient for many simple deployment scenarios — keeping in mind that the throughput also depends on the specific code your RAD Server modules execute.

Tip: For deployment on a public system, we recommend avoiding exposing the RSLite HTTP server directly, but making it accessible via a proxy configuration so you still have a web server (like Apache or IIS) providing the security context for the incoming HTTPS calls and forwarding those to RSLite.

How to get a RAD Server Lite License

You can redeem a license with any Enterprise or Architect license for RAD Studio 11 (including Delphi 11 and C++Builder 11). Visit this page and follow the instructions provided.

Note: You need your registration key and EDN account.

The process here is not just to receive a license key for RSLite, but a slip file (a license stored in a .TXT file) that you can deploy alongside your installation. This license has no limitations in terms of the number of installations, but you cannot have two instances running on the same machine.

Note: The license file needs to be placed in a specific sub folder, unlike what the general information on the redemption site might seem to imply.

Deploying a RAD Server Lite project

Once you have the license before you deploy a project, there are two different considerations:

  • First, you need to create a deployment configuration with RSLite, the required runtime packages, and IBToGo deployment (These are the steps)
  • Second you need to generate a proper database file for production, compatible with the IBToGo license — a local database created by RAD Server Developer edition won’t be compatible

The Files to Deploy

In practical terms, these are the files needed to deploy an RSLite solution (in addition to your application packages and their dependencies):

  1. The RSLite executable, which is the same of the developer edition: EMSDevServer.exe available in the RAD Studio bin folder (or the similar 64-bit version)
  2. The required RAD Studio runtime packages, which include those required for a minimal installation (listed here and available in the RAD Studio win32 or win64 redist folder) plus any other runtime package required by the code in your RAD Server modules:
    • bindengine280.bpl
    • dbrtl280.bpl
    • emsclientfiredac280.bpl
    • emsserverapi280.bpl
    • FireDAC280.bpl
    • FireDACCommon280.bpl
    • FireDACCommonDriver280.bpl
    • FireDACIBDriver280.bpl
    • rtl280.bpl
    • vcl280.bpl
    • vcldb280.bpl
    • vclFireDAC280.bpl
    • vclimg280.bpl
    • vclwinx280.bpl
    • vclx280.bpl
    • Xmlrtl280.bpl
  3. The InterBase ToGo deployment files found under the public document InterBase redist folder (for example, C:\Users\Public Documents\Embarcadero\Interbase redist\InterBase2020) in the subfolders win32_togo or win64_togo — for Linux you can find the libibtogo.so file in the proper InterBase redist folder
  4. Add the license file obtained above to the interbase/license folder (part of the IBToGo redist configuration)

Using the Deployment Wizard

Deploy your files using the RSLite feature in the Deployment Wizard by following these steps:

  1. Add the RSLite feature.
  2. Next, add the IBToGo feature.
  3. Uncheck the iblite registration file
  4. In the How to get a RAD Server Lite License section, add the file to deploy: generate a rslite activation file and set its destination as "interbase/license".
  5. Next, add the file obtained from the Creating the Production Database section to deploy my emsserver.ini to ./.
  6. Finally, add the file obtained from the Creating the Production Database section to deploy my emsserver.ib to ./.

MSVC runtime

In order to run IBToGo (and so RSLite using IBToGo) on a target Windows machine it needs to have the Visual C++ 2013 runtime library installed. On a developer machine with RAD Studio, you’d most likely have it already installed. On a general target deployment machine, however, you might have to install it, after downloading it from Microsoft.

Creating the Production Database

With this configuration, you can start the RSLite by executing the EMSDevServer.exe application. Note that if the target machine has an InterBase client, it will pick it up as a higher priority, and if the InterBase client is the Developer edition that comes with RAD Studio, everything will work but in a standard RAD Server Developer configuration.

You can figure this out by looking at the first few lines in the log when RAD Server starts. If it is an “RSLite” configuration, the first few lines will look like this:

{“Thread”:19124,”ConfigLoaded”:{“Filename”:”[folder]emsserver.ini”,”Exists”:true}}
{“Thread”:19124,”Licensing”:{“Lite”:true,”Licensed”:true,”LicensedMaxUsers”:2}}
{“Thread”:19124,”DBConnection”:{“InstanceName”:””,”Filename”:”[folder]emsserver.ib”}}

If the code indicates that “Lite” is set to false, you might need to manually disable loading of gds32.dll (or its 64-bit version) InterBase client library, generally found in C:\Windows\SysWOW64 (if the InterBase client library cannot be found it loads the local ibtogo.dll.

Now, if you start RSLite (with the proper configuration) and there is no emsserver.ini file and no emsserver.ib database file, it will prompt you to create one. For this to work, RSLite must find the configuration in RAD Studio’s Object Repository folder (ObjRepos under the product folder). The easier way to do this is to copy the files under Program Files (x86)\Embarcadero\Studio\22.0\ObjRepos\en\ems in a folder with this relative path from emsdevserver.exe: “../ObjRepos/en”. In other words, you need an ObjRepost folder at the same level directory as the folder containing your RSLite installation, the project deployment directory.

Note: This is not needed for each RSLite deployment, only once to generate a production database, you can later copy on the target computers as is. In fact, the database created in a development environment is not compatible with RSLite deployment.

We recommend you specify as the target folder the same as your RSLite deployment so that the wizard will create an emsserver.ini file and an emsserver.ib database file in your deployment folder. Now grab the entire folder with RSLite, these configuration files, the runtime packages, and IBToGo, including the license, and you have all you need to deploy on a target Windows computer.

Proxy Configuration

It is not recommended to expose RSLite directly as a public web application due to its limitations in terms or protection and encryption. We recommend using a proxy layer, with a dedicated service or using one of the popular web services as a front end. In Apache, for example, in you configure a virtual host, enable HTTPS, and redirect the traffics to the RSLite instance with a configuration like the following:

ProxyPass / http://localhost:8088
ProxyPassReverse / http://localhost:8088
ProxyPreserveHost On

For Linux

For Linux, you can follow similar steps as above, and everything should work as expected. As an alternative, you can also consider installing the full RAD Server and then adding IBToGo to the installation:

  • Install the RAD Server using the ems_install.sh available in the RAD installation folder. See Here
  • Copy the IBToGo files from the Interbase “redist” folder to the EMS folder on Linux (/usr/lib/ems)
  • Execute the EMSDevServerCommand and follow the wizard to create the EMS database and configuration file
    Note: You might need to run the application via sudo to have the proper permissions