apache gzip
1、首先启动模块mod_deflate.so和mod_headers.so
2、httpd.conf
#文件缓存时间配置
<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>
#GZIP压缩模块配置
<ifmodule mod_deflate>
#启用对特定MIME类型内容的压缩
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png|exe|t?gz|zip|bz2|sit|rar|pdf|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary #设置不对压缩的文件
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-httpd-php application/x-javascript #设置对压缩的文件
</ifmodule>
httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "D:/mb/mb03"
ServerName mb3.bridecool.com
<Location "/">
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary
</Location>
</VirtualHost>
//禁止目录访问
<VirtualHost *:80>
#禁止目录访问
<Directory "D:/website/2syx.com/Uploads">
Options -Indexes FollowSymLinks
#修改为 -Indexes 即可
</Directory>
。。。。。
</VirtualHost>