Here is the list:
apr apr-1.5.0.tar.gz
apr-util apr-util-1.5.3.tar.gz
pcre libpcre
zlib zlib
apache (actually I'm using 2.4.6) httpd-2.4.7.tar.gz
./configure --enable-deflateIf you need enable other modules you can specify in the command. Running above command may tip you missing libraries (in my server I miss apr/apr-util/pcre), just install them. When the configuration is done, run
makeThen apache should have been installed.
make install
To enable HTTP gzip compression, modify the httpd config file:
cd /usr/local/apache2vim conf/httpd.confAdd lines in the config files:
LoadModule deflate_module modules/mod_deflate.so
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
# You can't compress what is already compressed
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
# Make proxies work as they should.
<IfModule mod_headers.c>
Header append Vary User-Agent
</IfModule>
</IfModule>
bin/apachectl restart
Now your server has enabled gzip compression! You can validate whether you have succeed or not in this website HTTP gzip compression test .
No comments:
Post a Comment