This shows you the differences between two versions of the page.
apache_1.3.x_mod_gzip_sample_config [2010/03/27 05:16] k2patel |
apache_1.3.x_mod_gzip_sample_config [2020/08/10 02:35] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Apache 1.3.x + mod_gzip + sample config ====== | ||
- | ==== Installation ==== | ||
- | |||
- | It is easy to install but make sure your apache version is up2date just to avoid any errors.\\ | ||
- | |||
- | First Need to build mod_gzip. | ||
- | <code bash> | ||
- | cd /usr/ports/www/mod_gzip | ||
- | perl -pi -e Makefile 's/APXS=${APXS}/APXS=\/www\/apache\/bin\/apxs/g' | ||
- | make | ||
- | make install clean | ||
- | </code> | ||
- | |||
- | If you receive any google it but i have not received any error in at least 50 times. | ||
- | |||
- | ==== Configuration ==== | ||
- | |||
- | Make sure you enabled mod_gzip in httpd.conf. | ||
- | |||
- | <code apache | httpd.conf> | ||
- | LoadModule gzip_module libexec/mod_gzip.so | ||
- | </code> | ||
- | |||
- | Than enable following variables on your Directory variable. | ||
- | |||
- | <code apache | httpd.conf> | ||
- | mod_gzip_on Yes | ||
- | mod_gzip_can_negotiate Yes | ||
- | mod_gzip_static_suffix .gz | ||
- | AddEncoding gzip .gz | ||
- | mod_gzip_update_static No | ||
- | mod_gzip_command_version '/mod_gzip_status' | ||
- | mod_gzip_keep_workfiles No | ||
- | mod_gzip_maximum_file_size 500000 | ||
- | mod_gzip_maximum_inmem_size 60000 | ||
- | mod_gzip_min_http 1000 | ||
- | mod_gzip_handle_methods GET POST | ||
- | mod_gzip_item_include file \.html$ | ||
- | mod_gzip_item_exclude file \.js$ | ||
- | mod_gzip_item_exclude file \.css$ | ||
- | mod_gzip_item_include file \.pl$ | ||
- | mod_gzip_item_include file \.php$ | ||
- | mod_gzip_item_include handler ^cgi-script$ | ||
- | mod_gzip_item_include mime ^text/html$ | ||
- | mod_gzip_item_include mime ^text/plain$ | ||
- | mod_gzip_item_include mime ^httpd/unix-directory$ | ||
- | mod_gzip_item_exclude mime ^image/ | ||
- | </code> | ||
- | |||
- | ==== Testing ==== | ||
- | |||
- | Now go to following links and test if it works.\\ | ||
- | If not check error_log. | ||
- | |||
- | |||
- | * [[http://www.microsoft.com/search/tools/ | From Microsoft]] | ||
- | * [[http://www.whatsmyip.org/http_compression/ | What is my ip]] | ||
- | |||
- | ==== Common Errors ==== | ||
- | |||
- | == Error No.1 == | ||
- | |||
- | |||
- | <code bash> | ||
- | [error] mod_gzip: DECHUNK option is OFF in sendfile2 | ||
- | [error] mod_gzip: Cannot compress chunked response for [GET /index.shtml HTTP/1.1] | ||
- | [error] mod_gzip: ** Uncompressed responses that use 'Transfer-encoding: chunked' | ||
- | [error] mod_gzip: ** must be 'de-chunked' before they can be compressed. | ||
- | [error] mod_gzip: ** Turn DECHUNK option ON for this response category. | ||
- | </code> | ||
- | |||
- | RESOLUTION : | ||
- | |||
- | Add following line to your settings. | ||
- | |||
- | <code apache> | ||
- | mod_gzip_dechunk Yes | ||
- | </code> | ||
- | |||
- | == Error No.2 == | ||
- | |||
- | <code bash> | ||
- | 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=208131 -DMOD_PERL -DUSE_PERL_SSI -D_REENTRANT -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DMOD_DEFLATE -DEAPI -DEAPI_MM -O3 -fpic -DSHARED_MODULE -I/usr/local/ServeurWeb_1.3.41/apache_1.3.41/include -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] Erreur 1 | ||
- | </code> | ||
- | |||
- | RESOLUTION :\\ | ||
- | |||
- | change from : | ||
- | <code bash | Makefile> | ||
- | $(APXS) -Wc,-Wall,-O3,-fomit-frame-pointer,-pipe -c mod_gzip.c mod_gzip_debug.c mod_gzip_compress.c -o mod_gzip.so | ||
- | </code> | ||
- | |||
- | to | ||
- | <code bash | Makefile> | ||
- | $(APXS) -Wc "-Wall -O3 -fomit-frame-pointer -pipe" -c mod_gzip.c mod_gzip_debug.c mod_gzip_compress.c -o mod_gzip.so | ||
- | </code> |