Jitify for Apache Documentation

Overview

Jitify for Apache, also known as mod_jitify, is a plug-in module for the Apache 2.2 web server. It performs transformations on outbound content. It works with both static content (flat files in the Apache docroot) and dynamic content (PHP, mod_proxy, etc).

Jitify for Apache currently supports HTML, JavaScript, and CSS2 content. On requests for other content-types, it leaves the HTTP response body unmodified.

  1. If you don't already have an installation of Apache 2.2.x, download and install it. Make sure to enable mod_so for dynamic shared object support.
  2. Download the jitify-core source distribution
  3. Unpack the tar file:
            
    bunzip2 < jitify-core-version.tar.bz2 | tar xf -
    cd jitify-core-version
          
  4. Edit the Makefile: set the $APACHE_HOME variable at the top to point to the base of your Apache installation.
  5. Compile:
            
    make apache
          
  6. When the compilation completes, the file mod_jitify.so will be in the build subdirectory. Copy it into the modules subdirectory under your Apache installation.
  7. Add these lines to your httpd.conf:
            
    LoadModule jitify_module modules/mod_jitify.so
    <IfModule jitify_module>
        # Enable the minification transform
        Minify On
    </IfModule>
    
          
  8. Stop and restart Apache.

Configuration

Directives for use in httpd.conf:

  • Minify On|Off

    Turn minification on or off.

    This directive may be used at the top level in httpd.conf and within <Location> and <Directory> blocks

Logging

mod_jitify uses the standard Apache logging mechanism to write diagnostic information to the httpd error log file (normally logs/error_log). The amount of information logged depends on the LogLevel setting:

  • warn or higher: details of any syntax errors encountered while parsing content
  • info or higher: measurements of processing speed and before-and-after content size for each request
  • debug or higher: quite a bit of information about what the mod_jitify internals are doing