Apache2 mod_define not working

apache-2.2

I have used mod_define for Apache2 for a long time now in my Windows configuration. Now, I would like to move to Vagrant/Debian. However, I am facing difficulty reproducing the configuration in the virtual environment, which has Apache 2.2.22 installed.

The first problem I faced was being unable to compile the .so file: it kept telling me that the necessary libraries are not installed, and was refusing to install them. I don't remember how, but I managed eventually to compile. After this, I tried using it and it was not working, so I abandoned the idea for about a month.

Now, I'm back trying to make it work.
mod_define is installed, and is included in the output of apache2 -M, like so:

define_module (shared)

In my /etc/apache2/mods-available/define.load I have the following line:

LoadModule define_module      /usr/lib/apache2/modules/mod_define.so

So, it seems like it should work. However, when I try to start the server with apache2ctl start I get the following:

apache2: Syntax error on line 47 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/conf.d/gurudev.conf: Include directory '/etc/apache2/$ABC' not found
Action 'start' failed.
The Apache error log may have more information.

/var/log/apache2/error.log does not contain any new entries.
My /etc/apache2/conf.d/gurudev.conf file looks like this:

Define ABC "/var/www/.config/apache"
Include $ABC/*.conf

Looks like $ABC is not getting expanded to /var/www/.config/apache.

Has anyone encountered something like this before?
Or perhaps, my mod_define.so is broken? Maybe, somebody could send me theirs?

Best Answer

This just seems to be a limitation of mod_define and the Include directive for apache v2.2. You can used defined variables in many directives, but not in Include.

FYI, It works with apache v2.4's native Define directive