Increase the speed of your Apache by 10 times

  • 2020-05-06 12:11:17
  • OfStack

The magic module is mod_gzip. It USES the same compression algorithm as gzip to compress the page sent by apache into a tenth of its original size, if possible. Well, if a 10K page is only 1K, it's 10 times faster. Of course, the average web page can only reach 3-6 times. That's good, too. Isn't it. Even a big site like google USES this technology. Can't you follow me?

Such a good east, come to come, I tell you how to install: 3 steps, 1, download, 2, modify the configuration, 3, test.

1. Download

To http: / / www. remotecommunications. com/apache/download mod_gzip mod_gzip c and patch it.

2. Install, configure

put mod_gzip into your apache source directory, create a new mod_gzip directory and run
if you need a patch (for version 1.3.17.la) patch mod_gizp. c
Select dynamic DSO or statically compile to apache system in the configuration you need. How to do this is clear in README, such as -add-module = mod_gzip.c, make,make install, and so on. I won't go into that.

Add the following configuration to the httpd.conf tail.

# MOD_GZIP configuration
mod_gzip_on Yes
1002
mod_gzip_minimum_file_size mod_gzip_maximum_file_size 0
60000
mod_gzip_maximum_inmem_size mod_gzip_item_include mime "application/x - httpd - php
" mod_gzip_item_include mime text / *
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 "\. php3 $"
mod_gzip_item_include file "\. txt $"
mod_gzip_item_include file "\. html $"
mod_gzip_item_exclude file "\. css $"
mod_gzip_item_exclude file "\. js $"

Run
after saving the changes ... /bin/apachectl configtest ensures correct configuration changes.
The service is then restarted with the apachectl restart directive.

3. Modify and test

It's a good programmer's habit to test it before announcing it's done. To minimize the impact on your users, we can use the new apache driver on port 8080 or the command to control the directory where mod_gzip works, rather than all at once using mod_gzip.
Usage:

MOD_GZIP configuration

If you test it thoroughly again with IE4 or netscape, you can make your users happy and find that 'XX 'is now so fast. '

Mod_gzip is really amazing, the large HTML document of 100K can be sent to the client as long as 12K. The sooner you adopt this technique, the more impressed your users will be with the speed of your site. However, some gains must be lost, because the decompression is carried out in the client side, the effect and the user's browser has a certain relationship. I tested MSIE4,5,5.5,netscape 4.5, 6 all worked well, but java,jpg,gif, etc.

Related articles: