View Full Version : HELP - Gzip (Mod_Gzip)
The Realist
Tue 18th Dec '01, 4:47pm
Hi all,
I have been trying to configure my server to run with gzip and everytime I enter the details in the config file and restart apache it says "apache cannot restart server" or some words like it.
This is my php file:
http://www.skytronic-forums.com/phpinfo
trying to get forum to load faster.
Duron 1Gb processor,
512MB ram,
Linux 7.1,
plesk 2.0,
PHP Version 4.0.6,
mysql version 3.23.36.
Any pointers?
Brian
Dave#
Tue 18th Dec '01, 6:29pm
If it's modgzip rather than zlib then the most common errors are in your http.conf
make sure you load the module
LoadModule gzip_module modules/mod_gzip.so
then
AddModule mod_gzip.c
make sure ther rest of your conf is good to go
## mod_gzip settings ##
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_can_negotiate Yes
mod_gzip_dechunk Yes
mod_gzip_keep_workfiles No
# Exclude non http1.1 compliant browsers 1000=HTTP/1.0 1001=HTTP
/1.1
mod_gzip_min_http 1001
# Where to put work files
mod_gzip_temp_dir /tmp
# file size thresholds
mod_gzip_minimum_file_size 250
mod_gzip_maximum_file_size 300000
mod_gzip_maximum_inmem_size 300000
# File types
mod_gzip_item_include file \.htm$
mod_gzip_item_include file \.html$
mod_gzip_item_include file \.pl$
mod_gzip_item_include file \.cgi$
mod_gzip_item_include file \.asp$
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.php3$
mod_gzip_item_include file \.php4$
mod_gzip_item_include mime text/.*
mod_gzip_item_include mime ^application/x-httpd-php
mod_gzip_item_include mime ^httpd/unix-directory$
# Standard Netscape Caveats
# tell mod_gzip not to compress stuff sent in a posted form!
# these seem to be specific to my Resin Servlet handler
mod_gzip_item_exclude reqheader Content-Type:application/x-www-form-urle
ncoded
mod_gzip_item_exclude reqheader Content-Type:multipart/form-data
# compressed Cascading Style Sheets definitely don't render in Netscape
4.7x
mod_gzip_item_exclude file \.css$
# JavaScript don't compress so good
mod_gzip_item_exclude file "\.js$"
# NS 4.07 lies about 1.1 compliance
mod_gzip_item_exclude reqheader User-Agent:.*Mozilla.*4\.07
mod_gzip_item_include mime httpd/unix-directory
</IfModule>
The Realist
Wed 19th Dec '01, 1:25am
Still not working, says failed to start server when I try to restart?
Here is extracts from my conf file is it correct:
LoadModule expires_module libexec/mod_expires.so
LoadModule headers_module libexec/mod_headers.so
LoadModule usertrack_module libexec/mod_usertrack.so
LoadModule unique_id_module libexec/mod_unique_id.so
LoadModule setenvif_module libexec/mod_setenvif.so
LoadModule gzip_module_module libexec/mod_gzip.so
## mod_gzip settings ##
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_can_negotiate Yes
mod_gzip_dechunk Yes
mod_gzip_keep_workfiles No
# Exclude non http1.1 compliant browsers 1000=HTTP/1.0 1001=HTTP
/1.1
mod_gzip_min_http 1001
# Where to put work files
mod_gzip_temp_dir /tmp
# file size thresholds
mod_gzip_minimum_file_size 250
mod_gzip_maximum_file_size 300000
mod_gzip_maximum_inmem_size 300000
# File types
mod_gzip_item_include file \.htm$
mod_gzip_item_include file \.html$
mod_gzip_item_include file \.pl$
mod_gzip_item_include file \.cgi$
mod_gzip_item_include file \.asp$
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.php3$
mod_gzip_item_include file \.php4$
mod_gzip_item_include mime text/.*
mod_gzip_item_include mime ^application/x-httpd-php
mod_gzip_item_include mime ^httpd/unix-directory$
# Standard Netscape Caveats
# tell mod_gzip not to compress stuff sent in a posted form!
# these seem to be specific to my Resin Servlet handler
mod_gzip_item_exclude reqheader Content-Type:application/x-www-form-urle
ncoded
mod_gzip_item_exclude reqheader Content-Type:multipart/form-data
# compressed Cascading Style Sheets definitely don't render in Netscape
4.7x
mod_gzip_item_exclude file \.css$
# JavaScript don't compress so good
mod_gzip_item_exclude file "\.js$"
# NS 4.07 lies about 1.1 compliance
mod_gzip_item_exclude reqheader User-Agent:.*Mozilla.*4\.07
mod_gzip_item_include mime httpd/unix-directory
</IfModule>
Further down:
AddModule mod_usertrack.c
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_gzip.c
<IfDefine HAVE_SSL>
AddModule mod_ssl.c
</IfDefine>
<IfDefine FRONTPAGE>
AddModule mod_frontpage.c
</IfDefine>
AddModule mod_php4.c
AddModule mod_throttle.c
AddModule mod_perl.c
Thanks,
Brian :confused:
The Prohacker
Wed 19th Dec '01, 8:45am
Did you compile the .so yourself, or did you get it off gzip's homepage?
The Realist
Wed 19th Dec '01, 10:20am
Gzip homepage.
:confused:
The Prohacker
Wed 19th Dec '01, 1:08pm
Your going to have to compile from source, a good guide to do this is:
http://i4net.tv/marticle/get.php?action=getarticle&articleid=12
Look for the "Compiling mod_gzip from source code " section and follow those directions....
Dave#
Wed 19th Dec '01, 1:10pm
Your going to have to compile from source, a good guide to do this is:
Why? I never have to build from source ever?
The Prohacker
Wed 19th Dec '01, 1:21pm
Umm... I've never been able to get the precompiled .so to work. I've always had to compile for it, and I'm assuming that this is the case, considering he hasn't provided the exact error....
The Realist
Wed 19th Dec '01, 1:34pm
According to the instructions here: http://i4net.tv/marticle/get.php?action=getarticle&articleid=12 and following the section on Compiling mod_gzip from source code.
Within telenet I do a locate and look for apxs, I get this back:
/usr/local/psa/admin/bin/apxs
/usr/local/psa/admin/man/man8/apxs.8
/usr/local/psa/apache/bin/apxs
/usr/local/psa/apache/man/man8/apxs.8
/usr/local/psa/apache/htdocs/manual/programs/apxs.html
I presume my correct directory is:
/usr/local/psa/apache/bin
So I goto this directory and download this file to bin:
wget http://www.remotecommunications.com/apache/mod_gzip/src/1.3.19.1a/mod_gzip.c
I then try to carry on and follow the Instructions and try to run the following command:
apxs -i -a -c mod_gzip.c
I have tried all combinations I.E
/usr/local/psa/admin/bin apxs -i -a -c mod_gzip.c
And regardless what I do it says:
/usr/local/psa/apache/bin/apxs: No such file or directory
or
/usr/local/psa/apache/bin apxs -i -a -c mod_gzip.c
/usr/local/psa/apache/bin: is a directory
What Am I doing wrong?
:confused:
vBulletin® v3.8.0 Beta 4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.