Building And Installing The Module
Before building module you need to be assured that you have last compatible version of apxs2 installed on your system.
On Debian (Ubuntu) Linux you can install it with aptitude:
apt-get install apache2-threaded-dev
or:
apt-get install apache2-prefork-dev
regarding to Apache webserver version you use.
To build mod_hitlog as a DSO run:
apxs2 -c mod_hitlog.c
inside a module directory.
After building the module, you need to install it to your Apache modules directory. To complete this step run:
apxs2 -i mod_hitlog.la
Next, add the following directive to httpd.conf:
LoadModule hitlog_module modules/mod_hitlog.so
Using The Module
Using of hitlog_module is pretty simple. There are four configuration parameters you can use in server config for whole server, in config for any separate virtual host, or allow this directives in .htaccess files by setting in AllowOverride directive Options tag.
Here them are:
HitlogEnabled - turns on/off hitlog work. So the possible values are: "on"|"off"
HitlogCodePath - here you must specify a path to the file where additional content is stored. This mean that apache will try to read this file and add it contents to any HTML page after the tag, specified with teh next directive.
HitlogHtmlTag - specifies an HTML tag, after which an additional contant shoul be added. There are some rules exists for writing the tags
- You can specify pattern matching any symbols in tag by using "*" char, like <body*> - means that between "<body" and ">" can be anything else while ">" will be found. Other examples: <body*bgcolor="red"> - matching any of <body style="font-size:.9em" bgcolor="red"> or <body style="padding:0;margin:0;" bgcolor="red">
- Otherwise each tag will be split in a parts first of which contains everything infront of ">" bracket and a second part will contain the bracket ">". Anything else found btween this parts will be treated as successfully found tag element.
- If there placed a multiple tags on the page which satisfy the rules above it will be selected thet ag from the first found occurance.
- Default tag to which assertions should be glued is a <body*> tag.
HitlogCompression - turns on/off CLRF whitespaces optimization for the code read from the specified file. Possible values are "on"|"off".