Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 118375

Summary: optionnal activation of mod_deflate in apache 2.0.x
Product: Gentoo Linux Reporter: Aurélien Requiem <bugs>
Component: New packagesAssignee: Apache Team - Bugzilla Reports <apache-bugs>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: gentoo
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Aurélien Requiem 2006-01-09 02:55:53 UTC
Hello

It could be usefull to have the possibility to enable easyly mod_deflate in apache2 (like mod_ssl).

I've produce a small patch to do this (gentoo in mind).

The file is : /etc/apache2/modules.d/01_mod_deflate.conf 
<IfDefine GZIP>
	# Load the module first
	<IfModule !mod_deflate.c>
		LoadModule deflate_module modules/mod_deflate.so
	</IfModule>

	<ifModule mod_deflate.c>
		AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript application/x-javascript text/xml text/css
		BrowserMatch ^Mozilla/4 gzip-only-text/html
		BrowserMatch ^Mozilla/4\.0[678] no-gzip
		BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
		Header append Vary User-Agent env=!dont-vary

		DeflateCompressionLevel 9
		
		DeflateFilterNote ratio
		DeflateFilterNote Input instream
		DeflateFilterNote Output outstream
		LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" mod_deflate: In:%{instream}n Out:%{outstream}n:%{ratio}npct." combined_deflate
	</IfModule>
</IfDefine>


Please, note that the logformat is especially used to work with awstats. You may also rename the define GZIP to DEFLATE. And then place it in /etc/conf.d/apache2.

Feel free to contact me.

Thanks
Comment 1 Ben XO 2006-05-04 08:15:13 UTC
very useful, thanks! i use this for apache 2.0 (stable)
Comment 2 Benedikt Böhm (RETIRED) gentoo-dev 2006-06-06 08:57:57 UTC
we try to stay to upstream config as close as possible, which does not include a default defalte config