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.
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/mod_trim.so /apache/modules/dir/mod_trim.so
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/libmodtrim.so.0.0.0 /apache/modules/dir/mod_trim.so
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/mod_trim.so
# add filtering
FilterProvider trim-filter TRIM resp=Content-Type $text/html
FilterChain trim-filter
4. Restart apache and its done
post info - 2 Komentarzy | en | pl | Dodaj komentarz
