In an enterprise, there are a number of issues when deploying Apache with only the default configuration parameters, because those configurations are configured for the previous server.
One, web compression
1. Introduction
Configure Apache Web page compression function, is to use the GZIP compression algorithm to the Apache server published Web content compressed and then transferred to the client browser, so that the network to reduce the number of bytes transferred, speed up the loading of web pages, save traffic, improve the user experience, And using gzip has a better relationship with search engine crawlers.
The module that can realize the compression function has Mod_gzip module and Mod_deflate module.
The apache1.x series does not have built-in Web page compression technology, but can use additional third-party mod_gzip modules to perform compression
apache2.x official development of the time, the page compression into account, built a mod_deflate This module, can replace Mod_gzip
The difference between the two:
Mod_gzip to the CPU of the server higher, high compression ratio
Mod_deflate compression speed slightly faster
High-traffic servers, using mod_deflate may load faster than Mod_gzip
2. Operation method
Apachectl-t-D Dump_modules | grep "Mod_deflate" (if this module is not filtered out, it needs to be installed)
cd/usr/src/httpd-2.2.17
Service httpd Stop
./configue--enable-deflate
Make && make install
Vim/usr/local/httpd/conf/httpd.conf
Adding rows
Addoutputfilterbytype DEFLATE text/html text/plain text/css text/xml text/javascript (indicates what kind of content is enabled for compression)
Deflatecompressionlevel 9 (compression level)
Setoutputfilter DEFLATE (on behalf of the Enable DEFLATE module for gzip compression of the output of this site)
Service httpd Start
For ease of comparison, you can use the Grab kit tool analysis, such as the Fiddler tool under Windows, before enabling the Mod_deflate module.
The capture tool before compression shows:
After compression:
The server of Apache (iii)--Web and security optimization