httpd.conf for a caching proxy

Alles, was den Apache betrifft, kann hier besprochen werden.

httpd.conf for a caching proxy

Postby anti43 » 26. September 2008 09:46

Can you all help me to build a proxy server with caching capabilities.
The recommendations are:

- Disk cache every file above 1MB, regardless the headers sent
- Cache should never expire, so once cached files shall never be re-requested to the source
- Requests to port 80 (like a browser) should not throw an error, but present a page saying "This is a proxy"

The reason for me to need this is that i have a very limited bandwidth, and i do not want to download a file twice.

What i have so far:

Code: Select all
ThreadsPerChild 100
MaxRequestsPerChild  0

ServerRoot "C:\Program Files\Apache Software Foundation\Apache2.2"

Listen 25253

LoadModule status_module modules/
LoadModule authz_host_module modules/
LoadModule log_config_module modules/
LoadModule mime_module modules/
LoadModule proxy_module modules/
LoadModule proxy_http_module modules/
LoadModule proxy_connect_module modules/
LoadModule cache_module modules/
LoadModule disk_cache_module modules/

ServerName server

DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs"

ErrorLog logs/error.log
LogLevel debug

<IfModule log_config_module>
   LogFormat "%q %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
   LogFormat "%q %h %l %u %t \"%r\" %>s %b" common
   <IfModule logio_module>
     LogFormat "%q %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
   CustomLog logs/access.log common

<IfModule proxy_module>

ProxyRequests on
ProxyVia On
ProxyBadHeader Ignore
ProxyStatus On
ProxyPreserveHost On

<Proxy *>
   Order deny,allow
   Allow from all


<IfModule disk_cache_module>

CacheRoot "d:\cache"
CacheDefaultExpire 4320000
CacheMaxExpire 6048000
CacheMaxFileSize 1000000000000
CacheMinFileSize 1
CacheEnable disk /
CacheEnable disk http://
CacheDirLevels 5
CacheDirLength 3


<IfModule mod_status.c>
ExtendedStatus On

Thanks in advance for your help!
Posts: 2
Joined: 23. September 2008 08:41

Return to Apache

Who is online

Users browsing this forum: No registered users and 2 guests