Add Apache Modules

Adding Custom Apache Modules

When an application requires an Apache module that is not included in the platform by default, you can compile the module for the matching Apache version, upload the generated shared-object file, load it through httpd.conf, and restart the Apache node.

Create the Environment

1

Open the environment wizard

Sign in to the platform and click Create environment.

2

Select Apache PHP

Open the PHP tab, choose the Apache application server, define the required resources, enter the environment name, and click Create.

Create an Apache PHP environment
Create an Apache PHP environment with the required resources.
Apache PHP environment created
The created environment appears in the platform dashboard.

Build the Apache Module

  1. Download Apache HTTP Server development tools with the same version as the Apache server.
  2. Download the required module source. The documented example uses mod_pony.
  3. Compile and install the module with apxs.
apxs -i -a -c mod_pony.c

The compilation produces an Apache shared-object file. In the documented example, the result is:

/usr/lib64/httpd/modules/mod_pony.so
Version compatibility: Build the module against the same Apache version and compatible libraries used by the target server. The source page uses Apache 2.2.15 as its historical example.

Upload and Configure the Module

1

Open Configuration Manager

Locate the environment and click Config beside the Apache server.

Open Apache node configuration
Open Configuration Manager for the Apache server.
2

Upload the module file

Upload the generated .so file to /usr/lib64/php/modules.

Upload a custom Apache module
Upload the compiled Apache module to the server.
3

Load the module

Open /etc/httpd/conf/httpd.conf and add a LoadModule directive.

LoadModule {module-name}_module /usr/lib64/php/modules/{file-name}.so
LoadModule pony_module /usr/lib64/php/modules/mod_pony.so
Add LoadModule to httpd.conf
Add the LoadModule directive to Apache configuration.
4

Add module-specific settings

Configure the module according to its documentation. For the mod_pony example, create .htaccess under webroot/ROOT and add:

<Files pony>
SetHandler pony
</Files>
Configure the Apache module
Add the module-specific application configuration.
5

Restart Apache

Restart the Apache node after all module and application configuration changes are saved.

Check the Result

Click Open in browser for the environment, append /pony to the URL, and refresh the page.

Open the Apache application
Open the application in a browser to test the custom module.
Custom Apache pony module result
The custom module responds at the configured path.
Custom Apache module output
The mod_pony example confirms that the uploaded module is active.

Important Notes

  • Compile the module for the exact Apache version and architecture used by the target environment.
  • Use only trusted module source code.
  • Back up httpd.conf before adding a custom module.
  • An invalid or incompatible module can prevent Apache from starting.
  • Repeat the upload and configuration for all required nodes in a multi-node Apache layer.