modelina.net, modelina slawomir hess

Windowsupdate + squid

The main feature of proxy servers is caching. There is no obvious answer for the question - what type of web traffic should be cached. In my opinion - the updates are the best examples of files that should be cached. The caching saves the bandwitch that every desktop computer uses while normal working. It's transparent for the user. It's very fast. It can be shutdown if needed.

Squid

Squid is one of the most popular proxy server with very useful ability of the redirection. There are many free redirectors that you can download and install from internet. I use modified version of asqredirect because it's smallest and fastest. My modification makes a real difference of understanding the redirection. Now, we redirect the servers, not files. For example:
#pattern_url #redirect_url
http://www.wikipedia.com/static/help.html http://someserver.com/
Now the redirecton for the help.html file comes to http://someserver.com/www.wikipedia.com/static/help.html. So, you have to install apache server, then create someserver.com server configuration and www.wikipedia.com and static subfolder with help.html file.

Windowsupdate configuration (from urls.txt) is as followed
^http://(.*).windowsupdate\.com/msdownload/(.*)[0123456789]$ http://update.modelina.net/
^http://(.+).download\.windowsupdate\.com/(.*)[0123456789]$ http://update.modelina.net/
^http://(.*).windowsupdate\.com/msdownload/(.*)exe$ http://update.modelina.net/
^http://(.+).download\.windowsupdate\.com/(.*)msi$ http://update.modelina.net/
^http://(.+).download\.windowsupdate\.com/(.*)cab$ http://update.modelina.net/
^http://www\.update\.microsoft\.com/(.*)$ http://update.modelina.net/
As you see... I have update.modelina.net domain for this service.

Squid and Apache

Squid is only for redirection. The real cache server is now Apache, but it could be any web server with rewriting and php features. All files will be stored and shared via Apache. Why? Bacause it's easy to manage. All files are visible. You can log it.

Squid and Apache and PHP

We need a collector. All requests go to the index.php collector via .htaccess file:
.htaccess file:
Options +FollowSymLinks
RewriteEngine On
Order allow,deny
Allow from 127.0.0.1

RewriteBase /
RewriteRule (.*) index.php
#ErrorDocument 404 index.php
The real php script index.php tries to find the file from it's own url on the file system and if it's not here - download it and then serve. All this procedure is quick and transparent for the user.
index.php is unpublished. If you want it - write me.

Real example

- asredirect
- urls.txt (as shown)
- php script