Using the Apache module with a non-standard Apache2 install

Our Apache module is one of the recommended ways of integrating in Web stacks. We distribute our Apache module for many distributions, which should cover most of the production cases.

However, it may happen that your hosting provider or provisionning solution installs a custom version of Apache, in non-standard paths or with incompatible dependencies.

This page will guide you through the steps to get our Apache module work with your Apache2 install, whatever its setup.

Download and build the module

The's Apache module is available as an Opensource project in our github account.

  1. First, install some compilation tools and utilities:

    # Debian-based distribution
    apt install build-essential gawk wget unzip
    # RedHat-based distribution
    yum install gcc gawk wget unzip
  2. Ensure that apxs is installed on your system. apxs (also known as "APache eXtenSion tool") is a tool for building and installing extension modules for the Apache server:

    which apxs

    If this command does not return the full path of apxs, you need to install it. This depends on your distribution, but basically you can get apxs using one of the following commands:

    # Debian-based distribution
    apt install apache2-dev
    # RedHat-based distribution
    yum install httpd-devel
    # Amazon Linux
    yum install httpd24-devel
  3. Download the module:

    cd /tmp
  4. Then, simply build the module:

    cd libapache2-mod-redirectionio-0.3.2

Install the module in the right path

Installing the module should be quite straightforward in most cases:

make install

If this works, you're all set, congratulations! However, this step can fail if your Apache2 install does not use your distribution's standard Apache directories. In this case, you must copy the module to the appropriate folder.

  1. First, find the modules folder. This can be done by inspecting the apache configuration:

    /path/to/your/apache -V | grep SERVER_CONFIG_FILE
    # should display someting like: SERVER_CONFIG_FILE="/etc/apache-custom/httpd.conf"
    # which means the config file is "/etc/apache-custom/httpd.conf"

    Use cat to show the content of this file: you should notice several LoadModule directives, for instance LoadModule auth_basic_module lib/apache-custom/

    This means that the modules path is in /etc/apache-custom/lib/apache-custom/. Hurra \o/

  2. Move the module in this folder:

    # change the module permissions
    chmod 644 ./src/.libs/
    # then, copy it to the right location
    # (of course, use the path that you have found above)
    sudo mv ./src/.libs/ /etc/apache-custom/lib/apache-custom/
  3. Load the module in Apache - for this, simply add a LoadModule directive in httpd.conf, something like:

    LoadModule redirectionio_module lib/apache-custom/

    You may also want to add this line in a separate file, to keep track of your own changes. Most of the time, the main Apache2 configuration file includes other files (for example, IncludeOptional /etc/apache-custom/conf.d/*.conf) - feel free to add your own!

  4. reload Apache, and you're done!

    sudo systemctl reload apache2.service

You can check that the module fully works by completing its configurations steps in the VirtualHost.

Can't find your answer?