1. 설치
cd apache_home/bin
./apxs -i -a -c /usr/local/src/httpd-2.2.8/modules/filters/mod_deflate.c

2. 설정

추가
LoadModule deflate_module     modules/mod_deflate.so

<IfModule deflate_module>

   AddOutputFilterByType DEFLATE text/html text/plain text/xml
   AddOutputFilterByType DEFLATE application/xhtml+xml application/xml application/rss+xml
   AddOutputFilterByType DEFLATE text/css application/javascript application/x-javascript
   AddOutputFilterByType DEFLATE audio/midi

   DeflateCompressionLevel 9

   DeflateFilterNote Input instream
   DeflateFilterNote Output outstream
   DeflateFilterNote ratio

   #LogFormat '"%r" %b (%{ratio}n) "%{User-agent}i"' deflate
   LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
   CustomLog logs/deflate_log deflate

   # Netscape 4.x problem
   BrowserMatch ^Mozilla/4 gzip-only-text/html

   # Netscape 4.06-4.08 problem
   BrowserMatch ^Mozilla/4\.0[678] no-gzip

   # MSIE
   BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

   # no-gzip
   SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|jpg|png|bmp|zip|tar|rar|alz|a00|ace|txt|mp3|mpe?g|wav|asf|wma|wmv|swf|exe|pdf|doc|xsl|hwp|java|c|t?gz|bz2|7z)$ no-gzip dont-vary

</IfModule>



아파치 재시작

3. 테스트

로그 확인

phpinfo();

HTTP Compression Test



4. 참고
http://httpd.apache.org/docs/2.2/mod/mod_deflate.html

+ Recent posts