~sabdfl/apache-mod-digest/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
= mod_digest =

This is an Apache2 filter module that calculates the SHA1 digest of the
content served and stores it in a note, which can then be logged.

mod_digest is (c) Canonical, Ltd 2007, and published under the Apache
License.

== Installation ==

Under Ubuntu, the following should serve to install mod_digest. It assumes
you are using the threaded Apache structure:

  sudo apt-get install libssl-dev apache2-threaded-dev
  sudo apxs2 -i -c mod_digest.c

== Configuration ==

You will need to turn on filtering for the virtual server you wish to have
this information available from:

  * Edit /etc/apache2/sites-available/<server>
  * Insert a line like this in the relevant <Directory> stanza:
    SetOutputFilter digest
  * Add a custom log which includes the digest:
    CustomLog /var/log/apache2/sha1.log "%>s %200{SHA1DIGEST}n \"%U\""

You should then see lines like this in the log file:

  304 - "/index.html"
  200 0192ba11326fe2298c8cb4de616f4d4140213838 "/index.html"

Enjoy!
Mark Shuttleworth