HOWTO: Install mod_gzip

PHP's ob_gzhandler default compression level to -1 (6)
Change zlib.output_compression_level in php.ini to 1

Keep in mind gzipped html cannot be cached (at least in IE)
So if the page rarely updates, not gzipping the page would be best

I have a cron job who generate a new static page every 2 mins, doing 3 refresh within this timelaps using gzipped page (about 1KB each) would result in more bandwidth used than loading 3KB once
 
Just a note - I had followed this how-to about 3 mos ago and it worked great. I left my zlib.output_compression_level at -1 and did not see noticable CPU drag but definitely noticed large text pages loading faster.

However, after updating DA to the latest version (1.23.3), gzip went away and I had to come back and do this again.
 
Hi Guys,

Glad to see so many people using this tutorial. It is rather old, as someone brought up, but it does still work.

I am about to update it a bit, because sometime over the last few months I did resolve the image caching issue - and I will revise the tutorial to include the proper configuration.
 
mod_gzip download

File not available. :(

mod_gzip-1.3.26.1a.tgz?download&failedmirror=cogent.dl.sourceforge.net

Perhaps the topic can be updated to point to another file download location?

Thanx
 
Success!

Dramatic speed improvement across my sites.

Every webmaster should do this.

I found the file at another file repository by doing a file search on Google.

Then followed the steps, and everything seems to work just fine.

Thanks
 
Miva Merchant & Mod_GZip

As I said before, a dramatic speed/compression improvement in most of my pages.

I have a Miva website though, and it's output is not being compressed.

Any ideas?

Summary:
URL:

http://www.health-effects.net/Merchant2/merchant.m
vc?Screen=CTGY
Scope of analysis: Real-time data -- target file compression reports only (no supporting files).
Web server type:
Apache/1.3.31 (Unix) mod_gzip/1.3.26.1a mod_ssl/2.8.19 OpenSSL/0.9.7a PHP/4.3.8 mod_perl/1.27 FrontPage/5.0.2.2510
Compression status: Uncompressed

I have added

mod_gzip_item_include mime ^text/html$
mod_gzip_item_include mime ^text/plain$

to httpd.conf in an attempt to force it to compress, but no luck.

I looked high and low for help about this on Google, but couldn't find anything about that particular combination.

Any help is appreciated!

:confused:
 
i am getting this error:

[root@server02 mod_gzip-1.3.26.1a]# make install
/usr/sbin/apxs -A -i mod_gzip.so
Configuration file is not valid. There are sections closed before opened.
make: *** [install] Error 1
[root@server02 mod_gzip-1.3.26.1a]#

anyone an idea?
I edited the makefile to /usr/sbin/apxs
 
Last edited:
I had problems while compiling mod_gzip today, some strange errors like this :

[root@server mod_gzip-1.3.26.1a]# make build
/usr/sbin/apxs -Wc,-Wall,-O3,-fomit-frame-pointer,-pipe -c mod_gzip.c mod_gzip_debug.c mod_gzip_compress.c -o mod_gzip.so
gcc -DLINUX=22 -DHAVE_SET_DUMPABLE -DNO_DBM_REWRITEMAP -DMOD_SSL=208128 -DUSE_HSREGEX -DEAPI -DUSE_EXPAT -I../lib/expat-lite -fpic -DSHARED_MODULE -I/usr/include/apache -Wall,-O3,-fomit-frame-pointer,-pipe -c mod_gzip.c
cc1: error: unrecognized command line option "-Wall,-O3,-fomit-frame-pointer,-pipe"
apxs:Break: Command failed with rc=1
make: *** [build] Error 1

I have changed the Makefile to this :

APXS?=/usr/sbin/apxs
RM=/bin/rm

build:
$(APXS) -Wc "-Wall -O3 -fomit-frame-pointer -pipe" -c mod_gzip.c mod_gzip_debug.c mod_gzip_compress.c -o mod_gzip.so

install:
$(APXS) -A -i mod_gzip.so

clean:
$(RM) -rf *.o

distclean: clean
$(RM) -f mod_gzip.so

then simply run as the howto.

Enjoy.
 
Yes, this correction worked for me (Fedora 4, Apache 1.3.37 and PHP 4.4.4)

Thank you very much for having posted this.
 
Thanks for the information.

Your suggested changes worked here too, though, I did not try it first without them.
 
How to fix error:

Code:
/usr/sbin/apxs -Wc,-Wall,-O3,-fomit-frame-pointer,-pipe -c mod_gzip.c mod_gzip_d
ebug.c mod_gzip_compress.c -o mod_gzip.so
/var/www/build/libtool --silent --mode=compile gcc -prefer-pic  -DAP_HAVE_DESIGN
ATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/inc
lude/apache  -I/usr/include/apache   -I/usr/include/apache  -Wall,-O3,-fomit-fra
me-pointer,-pipe  -c -o mod_gzip.lo mod_gzip.c && touch mod_gzip.slo
cc1: error: unrecognized command line option "-Wall,-O3,-fomit-frame-pointer,-pi
pe"
apxs:Error: Command failed with rc=65536
.
make: *** [build] Error 1
 
Back
Top