Configuring Apache for Linux

There are some settings which must be adjusted before we can run the generated SO file.

1

Create module configuration files

Open a terminal and switch to the Apache mods-enabled directory:

Terminal
cd /etc/apache2/mods-enabled

Create a new configuration file (for example, using gedit) and add the following lines:

uni_apache.conf
<Location /uniapache>
  SetHandler libuniApache-handler
</Location>

Notes:

  • Location defines the virtual path or application alias. In this example the app will be accessible at: http://apache_server/uniapache

  • The handler name libuniApache-handler is formed by adding the suffix -handler to the name of your SO file.

Save this file as uni_apache.conf.

2

Create the module load file

In gedit create a new document and add the LoadModule line pointing to your module .so file:

uni_apache.load
LoadModule uniapache_module /home/linux_user/PAServer/scratch-dir/elite-Ubuntu64/uniApache/libuniApache.so

Save this new document as uni_apache.load.

This load file tells Apache the location of your module.

3

Module name in your project

The identifier uniapache_module is the name defined in your library project file. You can change it by editing your project DPR file. Example declaration:

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

Adjust Apache worker behavior (one-time)

By default Apache launches multiple worker processes. This conflicts with uniGUI session handling. Edit the mpm_event.conf file located under /etc/apache2/mods_enabled and set the worker parameters:

Open the file with sudo:

Terminal
sudo gedit mpm_event.conf

In the editor set:

{% endcode %}
{% endstep %}

{% step %}
## Restart Apache

Apply the changes by restarting Apache:

{% code title="Terminal" %}
```bash
sudo systemctl restart apache2.service
circle-info

Screenshots from the original instructions (kept for reference):

Screenshot from 2020-07-22 14-12-40

Screenshot from 2020-07-22 17-48-16