Configuring Apache to run uniGUI Apache Module

After creating the DLL file it is time to configure Apache 2.4 for Windows.

Consider that the DLL file is located at:

C:\Projects\uniApache\uniApache.dll
1

1. Edit Apache configuration

Open your Apache httpd.conf file with a text editor.

Add the following line to load your module:

httpd.conf
LoadModule uniapache_module "C:\\Projects\\uniApache\\uniApache.dll"

Note: the identifier uniapache_module is the export name of the module (see next step). You can change it in your project and then use the new name here.

2

2. Module export declaration (from your project)

The name uniapache_module comes from an export in your Delphi project. You will find a declaration similar to:

// Declare exported variable so that Apache can access this module.
var
  GModuleData: TApacheModuleData;
exports
  GModuleData name 'uniapache_module';

You may change the exported name in your project; if you do, update the LoadModule line accordingly.

3

3. Declare a virtual path (handler) for your application

In your httpd.conf file declare a Location for your application, for example:

<Location /uniapp>
    SetHandler uniApache-handler
</Location>
  • The handler name uniApache-handler is formed by appending -handler to the exported module name (e.g., uniapache -> uniapache-handler).

  • uniapp is an alias for your application and will be used to start a session in a browser tab (e.g., http://your-server/uniapp).

4

4. Restart Apache

To apply the changes restart the Apache server. You can do this from the Apache Service Monitor application.

Apache Service Monitor