Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two websites on my apache server. I have already enabled mod headers and deflates. in /etc/apache2/mod-available/deflate.conf i have written:

<IfModule mod_deflate.c>

SetOutputFilter DEFLATE
DeflateCompressionLevel 9

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio

LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate

Header append Vary User-Agent env=!dont-vary


but each time i check my website through the different commpression test the result is always: Compression status: Uncompressed

i tried to insert the code in /etc/apache2/site-available/ but it doesnt work. Have i missed something? I would be really gratefull if anyone can help.

share|improve this question

can you try adding in your v-host configuration, just for testing this:

<Location /tempFolder/>
        SetOutputFilter DEFLATE

restart apache and see if the responses get gziped - eg by:

wget --header "Accept-encoding: gzip"

if compression works - you should get file.txt that can be unpacked with gunzip.

maybe the mod_deflate is not loaded after all?

share|improve this answer
Thank you for ur answer , i have this error: TTP request sent, awaiting response... 404 Not Found 2013-05-13 13:50:42 ERROR 404: Not Found.i am sure that i have activated the mod-deflate and mod-header. i dont know where the problem comes from? – nazanin May 13 '13 at 15:49
but.. do you have tempFolder and there file.txt on your server? – pQd May 13 '13 at 19:45
i created a folder in my web folder. /var/www/mysite/tempFolder/ i gave 777 . i am not sure if its correct . but there is nothing inside. – nazanin May 14 '13 at 7:46
please put a test file called file.txt there and add some randome content to it. – pQd May 14 '13 at 8:23
its done, /var/www/mysite/tempFolder/file.txt , then in command line: wget --header "Accept-encoding: gzip" response: HTTP request sent, awaiting response... 404 Not Found 2013-05-14 14:43:04 ERROR 404: Not Found. in v-host file: RewriteRule ^tempFolder/.txt - [L] – nazanin May 14 '13 at 12:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.