Skip to main content.
8 April 2005

mod_gzip and Mac OS X Server

posted 6:45 PM EDT in Apple

I finally got around to installing the mod_gzip Apache module on the server which hosts my site, in an attempt to reduce my bandwidth usage and also hopefully speed up the site a little bit. Unfortunately, the speed increase probably won’t be noticeable until I get a faster computer in place, something I’m hoping to do by the end of the summer.

Compiling and installing the module for OS X Server merely requires making slight modifications to the project’s Makefile, compiling it as a shared library, enabling the module in Server Admin (where it automatically appears after installation, nice) and setting up the various configuration parameters in the site’s config file. A quick sudo apachectl graceful later, it’s up and running and dropping my outgoing file sizes by upwards of 70%, according to tests run from both PipeBoost and WebSiteOptimization.com. Neat!

Sadly, Server Admin is not smart enough to add the mod_gzip log file I set up to its display of log files in the Web pane; it only seems to know about the access and error logs.

Now I just need to see if I can trick awstats into taking all this into account and logging it somehow. That’ll be the next project. (And before anybody says anything, I’m not running it as a CGI.)

For reference, here are the config directives I’ve put in place for mod_gzip. Results may vary, of course.

none

2 Comments »

Follow any responses to this entry through the comments RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses to “mod_gzip and Mac OS X Server”

  1. nickshanks says:

    Hi there. I’m having problems with mod_gzip and was wondering if you could help out. If I compile it (10.4.3) using:
    gcc -DDARWIN -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -g -Os -pipe -DHARD_SERVER_LIMIT=2048 -DEAPI -DSHARED_MODULE -I/usr/include/httpd -Wall -O3 -fomit-frame-pointer -pipe -c mod_gzip.c mod_gzip_compress.c mod_gzip_debug.c -o mod_gzip.so
    I get a shared object file, which make install puts in the right place. However apache refuses to load the module. gcc doesn’t like the commas in the makefile in the “-Wall,-O3,-fomit-frame-pointer,-pipe” bit, so I took those out too.

    The error I get is:
    Cannot load /usr/libexec/httpd/mod_gzip.so into server: (reason unknown)
    and yes, the file exists, is +x etc, however it is only 452 bytes, whilst all the other .so files are 10k to 20k. Would you be able to send me your built version?

  2. nickshanks says:

    Never mind, I got it working. You might be interested in the following config changes I made though:

    mod_gzip_item_exclude file \.svgz$
    mod_gzip_item_include mime ^text/
    mod_gzip_item_exclude mime ^image/
    mod_gzip_item_exclude mime ^audio/
    mod_gzip_item_include mime ^application/.*\+xml$

    # Send HTTP Vary header
    mod_gzip_send_vary On

Leave a Reply

You must be logged in to post a comment.