Use mod_gzip to accelerate Zope and Apache

Source: Internet
Author: User
Article title: use mod_gzip to accelerate Zope and Apache. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: Xu permanent
  
We know that mod_gzip is an Apache module used by the server to compress the content requested by the customer and send it to the client. Zope on this site uses FastCGI to achieve integration with Apache. Apache is a service program for parsing HTML pages. After mod_gzip is installed, the common static pages can be compressed as well as the Zope document.
  
  
I. Installation
  
Http://www.hyperspacecommunications.com/products/mod_gzip.html
Download the mod_gzip binary code version and source code. If you use the former, copy the file to the libexec directory of Apache Home. After downloading mod_gzip.c, if your Apache is installed in DSO mode, run the following simple command to install it:
  
#/Www/bin/apxs-I-a-c mod_gzip.c
  
  
II. configuration
  
After installation, add the following configurations to httpd. conf:
  
# Mod_gzip configuration
LoadModule gzip_module libexec/mod_gzip.so
AddModule mod_gzip.c
  
Mod_gzip_on Yes
Mod_gzip_minimum_file_size 1002
Mod_gzip_maximum_file_size 0
Mod_gzip_maximum_inmem_size 60000
Mod_gzip_item_include mime "application/x-httpd-php"
Mod_gzip_item_include mime "text /*"
# Compressing Zope Content:
Mod_gzip_item_include file "[^.] * $"
Mod_gzip_item_include mime "httpd/unix-directory"
Mod_gzip_dechunk Yes
Mod_gzip_temp_dir "/tmp"
Mod_gzip_keep_workfiles No
Mod_gzip_item_include file "\. php $"
Mod_gzip_item_include file "\. txt $"
Mod_gzip_item_include file "\. html $"
Mod_gzip_item_exclude file "\. css $"
Mod_gzip_item_exclude file "\. js $"
  
  
And add the following rows:
  
LogFormat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "mod_gzip: % {mod_gzip_compression_ratio} npct. "mod_gzip
  
Modify the log file parameter in the corresponding VM configuration to mod_gzip
  
III. compression effect
In this way, we will get a log file similar to the following:
61.169.41.13--[02/Mar/2002: 01: 24: 29-0500] "GET/pipermail/freelamp/2002-March/41526.html HTTP/1.1" 200 72848 "http://www.freelamp.com/pipermail/freelamp/2002-March/subject.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; q312461; NetCaptor 6.5.0) "mod_gzip: 54pct.
61.169.41.13--[02/Mar/2002: 01: 24: 52-0500] "GET/new/publish/1003233602/index_html HTTP/1.1" 200 4304 "http://www.freelamp.com/new/publish/search? Subject = Zope & op = articles "" Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; NetCaptor 6.5.0) "mod_gzip: 65pct.
61.169.41.13--[02/Mar/2002: 01: 24: 53-0500] "GET/new/publish/global_css HTTP/1.1" 200 629 "http://www.freelamp.com/new/publish/1003233602/index_html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; NetCaptor 6.5.0) "mod_gzip: 73pct.
61.169.41.13--[02/Mar/2002: 01: 24: 54-0500] "GET/new/publish/Images/sitetitle_img HTTP/1.1" 304 0 "http://www.freelamp.com/new/publish/1003233602/index_html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; netCaptor 6.5.0) "mod_gzip: 0pct.
61.169.41.13--[02/Mar/2002: 01: 26: 21-0500] "GET/new/publish/index_html HTTP/1.1" 200 7317 "http://www.freelamp.com/new/publish/1003233602/index_html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; NetCaptor 6.5.0) "mod_gzip: 80pct.
61.169.41.13--[02/Mar/2002: 01: 26: 22-0500] "GET/new/publish/global_css HTTP/1.1" 200 629 "http://www.freelamp.com/new/publish/index_html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; NetCaptor 6.5.0) "mod_gzip: 73pct.
61.169.41.13--[02/Mar/2002: 01: 26: 24-0500] "GET/new/publish/TopicImages/Tutorial HTTP/1.1" 304 0 "http://www.freelamp.com/new/publish/index_html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; netCaptor 6.5.0) "mod_gzip: 0pct.
61.169.41.13--[02/Mar/2002: 01: 26: 24-0500] "GET/new/publish/LinkImages/jsp0020.img HTTP/1.1" 304 0 "http://www.freelamp.com/new/publish/index_html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; netCaptor 6.5.0) "mod_gzip: 0pct.
  
We can see that mod_gzip has compressed. html and those files without dots, and the compression ratio has reached 70-80%. However, mod_gzip does not compress the image file.
  
IV. Summary
Combined with mod_gzip and buffer tools, we can make a low-configuration PC capable of handling various HTML/CGI requests.
  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.