Monday, September 5, 2011

Configure Apache

We can use apache to serve static resource; infact apache is meant for this. Apache can cache data so that accessing resources is very quick. Proxy pass is the best way to do this.

<VirtualHost *:80>
DocumentRoot /root/cacheContent
<IfModule rewrite_module>
RewriteLog logs/rewrite.log
RewriteLogLevel 3

ProxyRequests off
ProxyPass /context/css/ !
ProxyPass /context/
ProxyPassReverse /context/

CacheEnable disk /
CacheEnable mem /

<IfModule mod_cache.c>
<IfModule mod_disk_cache.c>
CacheRoot /root/cacheContent/
CacheEnable disk /


So this is how it works. When ever u get /context on this ip send it to When ever u have static resources dont get it from the bakendContext. So in this case it gets it from /root/cacheContext/.


Some people make the world happen;
More watch the world happen;
Most wonder what happened.
Its your choice,
Which group you want to belong to.