Skip to main content

IBM HTTP Server for iSeries: HTTP Server (powered by Apache) and mod_deflate

Redbooks logo

Abstract

mod_deflate is a powerful module that allows you to compress, by configuration, files being served from your HTTP Server (powered by Apache). mod_deflate is Apache's open source equivalent to mod_gzip. Compressing the data before it is sent by your HTTP Server (powered by Apache) can dramatically save on network delays caused by bandwidth restrictions. The data is uncompressed at the remote client’s Web browser. mod_deflate is particularly useful in networks where individual network links are saturated with traffic or the end-user is connected via modem.

As an anecdotal example, consider the /index.html home page that is served from the NetObjects Fusion generated sample Web application used in the redbook "HTTP Server (powered by Apache): An Integrated Solution for IBM eServer iSeries Servers", SG24-6716. It is compressed by mod_deflate from 10867 to 2002 bytes. Another example shows that the Hypertext Markup Language (HTML) output of a Net.Data macro is compressed from 10631 to 2869 bytes. Some files do not compress as well. Examples are JPEGs, PDFs, and files that are already compressed. mod_deflate allows you to configure which types of files are compressed and which are not.

Also, some documents are not supported by a browser in compressed form, such as JavaScript (.js). In such cases, they must be excluded. They may work in the future, but for now, it can create more problems than benefits.

And, of course, nothing is for free. This processing takes additional CPU and memory on your IBM eServer iSeries server as well as on the remote client browser. You must determine whether the savings in the size of the documents you are sending through the network outweigh the performance impact on the server and client.

Contents

The following information was extracted from HTTP Server (powered by Apache): An Integrated Solution for IBM ~iSeries Servers, SG24-6716, which is currently a draft redbook (Redpiece). This redbook has more details and provides step-by-step instructions. You can access the latest version from the IBM Redbooks Web site at:

http://www.redbooks.ibm.com/

Search for SG24-6716.


mod_deflate: Compress, by configuration

This function is available for 5722-DG1 at V5R1 and V5R2 via program temporary fixes (PTFs). One of the PTFs contains zlib. You can find more information about zlib at:
http://www.gzip.org/zlib/

On this Web site, they announce that zlib is “A Massively Spiffy Yet Delicately Unobtrusive Compression Library”. The other PTF contains the mod_deflate module plug-in. The DG1 PTFs are:

  • V5R1: PTFs SI09287 and SI09223
  • V5R2: PTFs SI09286 and SI09224

Example configuration

The following sample configuration provides a simple starting point for configuration and use of mod_deflate.


mod_deflate only a few MIME types in a context using AddOutputFilterByType

Using AddOutputFilterByType seems to be the preferred way to handle the idiosyncrasies of the many different Web browsers on the Internet. You can use the more complex examples (as demonstrated in the redbook HTTP Server (powered by Apache): An Integrated Solution for IBM ~ iSeries servers, SG24-6716). However, that complexity invites the opportunity for an error – either as part of your configuration or from the Web client’s ability to handle a certain MIME type. For example, are you going to test to see what versions of Netscape can handle compressed PDFs over an SSL encrypted session?

The key directives needed to support mod_deflate in the httpd.conf file are shown in the following example and are in bold.

Note: Most of the other directives that do not directly affect this example have been removed.


    # Configuration originally created by Apache Setup Wizard Wed Apr 30 15:38:30 UTC 2003
    LoadModule deflate_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
    Listen *:8000
    DocumentRoot /tcp52d00/basicconfig/itsoco
    ServerRoot /tcp52d00/basicconfig
    ...
    <Directory />
    Order Deny,Allow
    Deny From all
    </Directory>
    <Directory /tcp52d00/basicconfig/itsoco>
    Order Allow,Deny
    Allow From all
    AddOutputFilterByType DEFLATE text/html text/plain text/xml
    </Directory>

Special Notices

This material has not been submitted to any formal IBM test and is published AS IS. It has not been the subject of rigorous review. IBM assumes no responsibility for its accuracy or completeness. The use of this information or the implementation of any of these techniques is a client responsibility and depends upon the client's ability to evaluate and integrate them into the client's operational environment.

Profile

Publish Date
26 August 2003


Rating: Not yet rated


Author(s)

IBM Form Number
TIPS0288