mod_header_modify 20020604 review
Downloadmod_header_modify Apache module can change or remove incoming http headers and it can also add headers that weren't sent by the clien
|
|
mod_header_modify Apache module can change or remove incoming http headers and it can also add headers that weren't sent by the client. It can thus be used to manipulate the behaviour of content handlers that you don't want to (or can't) change. Another option might be to simulate various user agents, perhaps in conjuction with mod_rewrite.
Requirements:
mod_header_modify has been tested successfully with Apache 1.3.23 on Linux 2.4.19 but I think it should work with all recent Apache releases and on all supported platforms. Please let me know about your attempts (whether successful or not) with other operating systems or other versions of Apache.
You'll need a working C compiler and its associated utilities, of course. If you've built your Apache from a source distribution you almost certainly have one... :)
Installation:
There are at least two ways to install this module. Which one is appropriate depends on your Apache installation.
The easy way: If your Apache is compiled with support for dynamically loadable modules (also called DSO support), you'll just have to find out where apxs is located. Go to the directory where you unpacked the mod_header_modify.c source file and let apxs do the work:
/usr/local/apache/bin/apxs -c -i -a mod_header_modify.c
This will build mod_header_modify.so as a shared object (the -c option), install the module in the right place (-i) and add the LoadModule directive to your httpd.conf file (-a). See the apxs manual page for details about these and other command line options.
If you don't know if you have DSO support, don't worry - apxs will complain in case you haven't. You can also check beforehand by letting Apache list all compiled-in modules with httpd -l. If mod_so.c is one of them, you're lucky.
The hard way: Without DSO support you will have to rebuild Apache to use mod_header_modify. (You might consider building it with DSO support this time...) Create a new directory like, say, site underneath the src/modules directory in Apache's source tree and put the mod_header_modify.c file there. Now configure Apache with
./configure --activate-module=src/modules/site/mod_header_modify.c
--enable-module=header_modify
and don't forget the other configuration options that you need. You can now build and install a new httpd as usual.
mod_header_modify 20020604 search tags