Search code examples
delphiapacheapache2delphi-2010

Apache 2.2 module


I want to create an apache 2(2.2.21 to be more specific) module in Delphi 2010, however I find it extremely difficult due to the fact that delphi no longer supports creating a web server application as an apache 2.X module.

I've searched for hours but no luck, changed a few constants like:

MODULE_MAGIC_COOKIE = $041503232;
MODULE_MAGIC_NUMBER_MAJOR = 20051115;
MODULE_MAGIC_NUMBER_MINOR = 0;

based on what I've found in my searches.

in my httpd.conf file I've added:

LoadModule mymodule_module modules/mod_mymodule.so

however, apache fails to load it, it says that it cannot find the module, but I've copied it to apache's module folder, I'm certain that it's there, I believe something fails in the initiation of the module, I do not know what tho.

I'm using:

  • Delphi 2010
  • Apache 2.2.21

Solution

  • I've made an Apache 2.2 module under the xxm project, and indeed had to do a lot of work to get the library registration in order. The project is primarily made in Delphi 7, but I've taken care to use AnsiString/WideString specifically wherever possible, so it should compile and work under newer Delphi versions. You can view the source here:

    http://xxm.svn.sourceforge.net/viewvc/xxm/trunk/Delphi/apache/