Today is a good day to code

Installing mod_gzip on the Xserve G5

Posted: December 31st, 1969 | Author: | Filed under: Uncategorized | No Comments »

Installing mod_gzip on the Xserve G5

Picture of IrvinThe other thing that I did this weekend was to install mod_gzip into the default Apache 1.3 install that comes with Mac OS X 10.4 Server.

Installation was painfully easy, although there was a little consternation on my part when I couldn't get make to run in my SSH session on the Xserve. For some reason make, sudo make, and sudo make install just wouldn't execute. I had to build the .so file on my local 10.4 client installation, and then move the .so into the /usr/libexec/httpd/ folder. Once I did that it was really easy to go into the Server Admin to add, and enable the module.

I noticed about a 20% drop in my bandwidth usage for the past few days, and the file sizes from the blog site have dropped by about 50%. When I first started running mod_gzip, I noticed some serious CPU usage, but when I checked it later, it had mostly cooled out. I had some help in setting it up. Here are the sites that helped me:

Compiling mod_gzip for OS X

*Update – 1/11/2006*

I discovered almost a day after working on the site that the .cfm content wasn't being gzipped. I worked through tons of different issues with the filters and none of them fixed the issue. Eventually I came across a post that said that sometimes even though you think that all of your modules are loading after mod_gzip, IE mod_gzip is at the bottom of your modules list, they may not be. The list in your response headers usually will be in the order in which they loaded. I noticed that the module was loading before anything. I kept looking through my httpd.conf trying lots of different things when I noticed that the loadModule statement for JRun was down at the bottom with its >IfModule> statement.

I then simply moved the entire statement including its IfModule up into the where all of the other loadModule statements were, and made sure that the mod_gzip module was loaded after all of them. It still didn't work. Now mod_gzip was processing everything but the ColdFusion templates, and mod_jrun was nowhere to be found.

I went back into my httpd.conf file and saw that there was no AddModule statement for mod_jrun.c. When I added that, below the AddModule statement for mod_gzip.c, in tandem with having the mod_jrun loadModule statement after the loadModule statement for mod_gzip, it was compressing .cfm templates with no problems. Even the flash paper output of ColdFusion 7 wasn't messing with it. I am happy with mod_gzip, the CPU bump is negligible, and my page size dropped by almost 50%. Also, my sitemap.xml file for Google will be nice and small for the near term so that shouldn't cause their crawler any problems.