This is a discussion on apache2 reverse proxy & mod_mem_cache, not working within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, everything is in the subject.. using apache 2.0.53-5 on debian testing i've setup some apache2 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
everything is in the subject.. using apache 2.0.53-5 on debian testing i've setup some apache2 http reverse proxies to act as a frontend for some backend IIS6 servers, everything works fine so far. i'm using some basic ProxyPass/ProxypassReverse setup for some of them and some more "advanced" RewriteRules for others. Now i'd like to use apache2 caching modules to let apache cache some pages and files and serve them directly to the client.. My "advanced" rproxy conf looks like that (virtual host conf) ------------------- ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> RewriteEngine On RewriteLog /var/log/apache2/sub.domain.tld/rewrite.log RewriteLogLevel 3 RewriteRule ^/?(str1|str2)/?(.*)? http://backendserver/$2 [E=EnvLang:$1,P,L] RewriteRule ^/?(.*) http://backendserver/$1 [P,L] # Add HTTP Header required for language env RequestHeader add AX-Rewrite-URL %{EnvLang}e # Reverse proxy <Location /> ProxyPassReverse / <LimitExcept GET POST HEAD> Order allow,deny Deny from all </LimitExcept> </Location> --------------- the basic conf would simply use ProxyPass / http://backendserver/ instead of all the Rewrite crap ---------------- don't worry about the RequestHeader thing it's a trick i have to use in order to let the backend server initiate the proper env langage for the requested url One other thing, the mod_proxy.conf file has an additional conf parameter which is "ProxyVia On" now i've loaded mod_mem_cache and mod_cache and i've added the following peace of conf <IfModule mod_cache.c> # <IfModule mod_disk_cache.c> # CacheRoot /tmp/apachecache # CacheSize 5000000 # CacheEnable disk /fr # CacheDisable /fr/images # CacheDisable /en # </IfModule> <IfModule mod_mem_cache.c> CacheEnable mem / CacheDefaultExpire 1800 CacheDisable /images CacheIgnoreCacheControl On CacheIgnoreNoLastMod On CacheMaxExpire 3600 MCacheSize 8192 MCacheMaxObjectCount 100 MCacheMinObjectSize 1 MCacheMaxObjectSize 204800 </IfModule> </IfModule> All the dynamic documents are located in the root and all the other files are pictures in /images so i've disabled caching for pictures now for a reason i don't really understand caching doesn't work.. i simply check that on a test backend server by requesting an url and monitoring the backend server cpu load.. if the dynamic file was cached and served by apache the backend server wouldn't have anything to do besides sending pictures and i wouldn't see any cpu load peak.. I know that debug method is lame but i haven't found any ways to debug apache caching yet and as it doesn't seem to work i have nothing in the access/error logs that would say otherwise.. So if anyone has an idea about what's wrong with my proxy/mem_cache conf i'd really appreciate it.. I was wondering if i had anything special to do about expiry headers/conf on the backend server documents or on apache thru maybe another module like mod_expire ? I'd also really like to have a good way to debug/trace apache caching.. haven't found anything to monitor apache caching.. Thx for your time Marc |
| Thread Tools | |
| Display Modes | |
|
|