Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Webmaster > Tips and Tricks

August 30th, 2007, 13:10 GMT · By Adrian Placinta

Create Loadable Modules for Apache on Windows

SHARE:

Adjust text size:


LoadModules
Enlarge picture
The main advantage of Apache is that you can use many Unix modules on Windows platform with no change or changing just a little bit. Other modules depend on aspects of the Unix architecture which are not present in Windows, and will not work.

You can add the modules in Apache using
two methods. The first is to compile
the module directly into the server. Unfortunately, this can be done only in Unix. In Windows you can't do that, so you must add the source code of the module to the ApacheCore project file, and its symbols must be added to the oswin32modules.c file.

The second method is to create a DLL, compiling the source code of the module. Then you will load the module using the LoadModule directive. The main advantage is that you can distribute your module with Apache distribution and the user won't recompile the Apache sources.

To create a DLL you have to make a small change to the module's source code: you must export the module record from the DLL. In your module's record definition add the AP_MODULE_DECLARE_DATA. This is defined in the Apache header files. So, if your module has:

module softpedia_module;

Replace the above with:

module AP_MODULE_DECLARE_DATA softpedia_module;

This will only be activated on Windows. You can use it unchanged with Unix if you need it.

After that, create a DLL containing your module. To do so, link this against the libhttpd.lib export library. This is created after you compile the libhttpd.dll shared library that is located in your server root's modules directory. It is best to grab an existing module .dsp file from the tree to assure the build environment is configured correctly, or alternately compare the compiler and link options to your .dsp.

Place the DLL in the modules directory of your server root, and use the LoadModule directive to load it.

LoadModule softpedia_module modules/mod_softpedia.so;
FILED UNDER:
Apache
Unix
Windows

TELL US WHAT YOU THINK:

3,227 hits · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


Monitoring a Linux System with X11/Console/Web-Based Tools

How to Setup a Mail Server on FC6

Apache service and command prompt

Manually Configure PHP5 and Apache2

READER COMMENTS:



No user comments yet.
Be the first to express your opinion!
Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM