Lasso Soft Inc. > Home

  • Articles

Updating mod_fastcgi to work with mod_deflate

Note: This applies only to Lasso 9.1.3 and earlier. Lasso 9.1.4 and later uses its own customized FastCGI connector for which this is not an issue.

On Apache web servers, it's common practice to enable compression of served pages to improve load times by enabling mod_deflate. However, there is a bug in the current version of mod_fastcgi (which Lasso 9 relies on), resulting in noticeable delays when loading pages if mod_deflate is used. This can be fixed by compiling and installing the latest snapshot of mod_fastcgi.

Technical details

According to this Debian bug report and the pages it references, mod_fastcgi 2.4.6 and earlier stores the Content-Length value in the wrong table and serves it from there, while mod_deflate rewrites the correct Content_Length value, which mod_fastcgi fails to serve. The latest snapshot of mod_fastcgi doesn't send a Content-Length header if mod_deflate is used, which doesn't fix the core problem, but does make it work properly for Lasso 9.

Instructions

Download and expand the archive at http://www.fastcgi.com/dist/mod_fastcgi-SNAP-0910052141.tar.gz to your home directory:

cd ~
wget http://www.fastcgi.com/dist/mod_fastcgi-SNAP-0910052141.tar.gz
tar xvfz mod_fastcgi-SNAP-0910052141.tar.gz
cd mod_fastcgi-SNAP-0910052141/

Assuming you're running Apache 2, copy the Makefile.AP2 file as Makefile:

cp Makefile.AP2 Makefile

From here on, instructions differ depending on your server's platform. 

Linux (Red Hat, CentOS, etc.)

This is assuming mod_fastcgi is already installed and running on your system; check http://www.cyberciti.biz/tips/rhel-centos-fedora-apache2-fastcgi-php-configuration.html for help if it's not.

Install the packages required for development:

yum -y install glibc-devel libtool httpd-devel apr-devel apr

Compile & install mod_fastcgi.

First, check your architecture with uname -i.
For a 32-bit system:

make top_dir=/usr/lib/httpd
make install top_dir=/usr/lib/httpd

For a 64-bit system:

make top_dir=/usr/lib64/httpd
make install top_dir=/usr/lib64/httpd

Finally, restart Apache.

apachectl -k restart

Mac OS X, Mac OS X Server

For this to work, you must have Developer Tools installed, available from developer.apple.com or your system software DVD.

Run the following command to create a universal binary:

10.5 Leopard:
make top_dir=/usr/share/httpd CFLAGS="-mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch x86_64"

10.6 Snow Leopard:
make top_dir=/usr/share/httpd CFLAGS="-mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64"

Rename the original module (optional) and install the new version, then restart Apache.

sudo mv /usr/libexec/apache2/mod_fastcgi.{so,original}
sudo cp .libs/mod_fastcgi.so /usr/libexec/apache2
sudo apachectl -k restart

And that's it.

Important note

Version 2.4.7 of mod_fastcgi breaks HTTPAuth in earlier versions of Lasso 9, because it's passing the header as "HTTP_AUTHORIZATION", but Lasso is expecting a header called "Authorization". This is fixed in recent releases of Lasso 9.

Author: Eric Knibbe
Created: 24 Feb 2011
Last Modified: 16 Mar 2011

Comments

No comments found
You must be logged in to comment.

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft