Apache module: mod_trim

Trim filter is an apache module that removes unnecessary white spaces from xhtml/xml/html content. It is useful when you serve webpages to mobile devices. It is based on trim-filter for Sun One Web Server (iPlanet).

License: mod_trim is released under LGPL.


Version 1.0

1. Installation using apxs # path is optional you can use it if apxs is not in PATH # or apxs name is apxs2 :-) ./configure --with-apxs[=/path/to/apxs] make -f src/Makefile.apxs # apache module dir can be: /etc/httpd/modules, /usr/lib/httpd/modules, # /etc/apache/modules, /usr/libexec) cp ./src/.libs/ /apache/modules/dir/

2. Without apxs e.g. self compiled apache ./configure --with-apache=/apache/src/dir make # apache module dir can be: /etc/httpd/modules, /usr/lib/httpd/modules, # /etc/apache/modules, /usr/libexec) cp ./src/.libs/ /apache/modules/dir/

3. Apache configuration To enable mod_trim in apache you have edit httpd.conf: # enable module (this line should sometimes be added #in modules.conf if you have one) LoadModule trim_module modules/ # add filtering FilterProvider trim-filter TRIM resp=Content-Type $text/html FilterChain trim-filter

4. Restart apache and its done