Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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


</IfModule>

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/mysite.com but it doesnt work. Have i missed something? I would be really gratefull if anyone can help.

share|improve this question

1 Answer 1

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

<Location /tempFolder/>
        SetOutputFilter DEFLATE
</Location>

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

wget --header "Accept-encoding: gzip" http://host.name/tempFolder/file.txt

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" mysite.com/tempFolder/file.txt 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

 
discard

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.