Jaime Frutos Morales's blog


How to configure mod_deflate for Apache on Ubuntu 10.10

Filed under: SysAdmin, Ubuntu — acidborg @ 12:51

Description: mod_deflate is an Apache module which “provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.” (from its web). This means that you save some bandwidth in exchange for some CPU cycles compressing the data your Apache server sends.

Installation: If you have Apache installed, you don’t need additional packages, because this module belongs to the package “apache2.2-common“.


  1. Enable the mod_deflate module: sudo a2enmod deflate
  2. Edit /etc/apache2/mods-enabled/deflate.conf with the following content:
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript application/javascript application/ecmascript application/rss+xml text/x-js
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  3. Restart Apache: sudo /etc/init.d/apache2 restart

NOTE: There are some old versions of some browsers which don’t support this kind of compression, although it’s included in RFC 2616 (HTTP/1.1). http-compression.com has more info about it.

1 Comment

  1. […] Adres URL: How to configure mod_deflate for Apache on Ubuntu 10.10 « Jaime … […]

    Pingback by How to configure mod_deflate for Apache on Ubuntu 10.10 « Jaime … « apache — 13/10/2010 @ 16:58

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Blog at WordPress.com.

%d bloggers like this: