Forum Moderators: phranque
## Default Virtual Host Configuration<VirtualHost *:88>
ServerName proxy
ServerAdmin admin@example.com
ProxyRequests On
CacheRoot "/var/run/proxy"
CacheSize 1024
CacheLastModifiedFactor 0
CacheGcInterval 24
ProxyRemote [homepage...] [mystartpage.com...]
<IfModule mod_ssl.c>
SSLEngine Off
SSLLog "/var/log/httpd/ssl_engine_log"
SSLCertificateChainFile "/etc/httpd/ssl.crt/ca.crtX"
SSLCertificateFile "/etc/httpd/ssl.crt/server.crtX"
SSLCertificateKeyFile "/etc/httpd/ssl.key/server.keyX"
SSLCipherSuite "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:!SSLv2:+EXP:+eNULL"
</IfModule>
<IfModule mod_dav.c>
DAVLockDB "/var/run/davlocks/.davlock100"
DAVMinTimeout 600
</IfModule>
<Directory "proxy:*">
AuthName "v710"
<Limit GET HEAD OPTIONS CONNECT POST PROPFIND>
Require user proxyuser
</Limit>
<Limit PUT DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Require no-user
</Limit>
AuthType Basic
</Directory>
<Directory "/Library/WebServer/Documents">
Options +Indexes +ExecCGI
<IfModule mod_dav.c>
DAV On
</IfModule>
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
</IfModule>
<IfModule mod_alias.c>
</IfModule>
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_temp_dir /tmp
mod_gzip_keep_workfiles No
mod_gzip_minimum_file_size 500
mod_gzip_maximum_file_size 5000000
mod_gzip_maximum_inmem_size 1000000
mod_gzip_min_http 1000
mod_gzip_handle_methods GET POST
mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
mod_gzip_item_include file .html$
mod_gzip_item_include file .shtml$
mod_gzip_item_include file .htm$
mod_gzip_item_include file .shtm$
mod_gzip_item_include file .php$
mod_gzip_item_include file .phtml$
mod_gzip_item_include file .pl$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include handler proxy-server
mod_gzip_item_include mime ^text/html$
mod_gzip_item_include mime ^text/plain$
mod_gzip_item_include mime ^httpd/unix-directory$
mod_gzip_item_exclude mime ^image/
mod_gzip_dechunk Yes
mod_gzip_add_header_count Yes
mod_gzip_send_vary On
</IfModule>
LogLevel warn
</VirtualHost>
To verify that a site is or is not already compressed, I use this.
[whatsmyip.org...]
And to verify that a site is or is not getting compressed through my proxy, I use the Page Info option in FireFox, which tells you the size of the document (if compressed, the file size matches the compressed value from the gzip test. If not, it matches the uncompressed size)
From what I read, you just have to add that one proxy-server handler to your mod_gzip config and you are good to go. Unfortunately, I am not good to go. Also, I tried doing the access log trick where each log entry also shows the size pre and post gzip compression. For some reason, this doesn't work, and I don't get any size numbers at all in my logs.
Let me know if you have any thoughts on this...