Kunaljain's Weblog

September 25, 2007

Reverse Squid Proxy

Filed under: Reverse Squid Proxy — Kunal Jain @ 04:55

Installing reverse squid proxy 2.6

Get the source code http://www.squid-cache.org/Versions/

cd /usr/local/src/

tar -xvf /home/user/download/squid-2.6.STABLE16-20070906.tar.gz

cd /usr/local/src/squid-2.6.STABLE16-20070906/

./configure
make
make install

open the file /usr/local/squid/squid.conf and make the following changes

http_port 8880 transparent

#cache_store_log none
emulate_httpd_log on
redirect_children 5

acl sites dstdomain mydomain.com
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80

#acl Safe_ports port 21
acl Safe_ports port 443 563
acl Safe_ports port 1025-65535 # unregistered ports
acl CONNECT method CONNECT

acl Safe_methods method GET POST
http_access deny !Safe_methods
http_access allow all sites
http_access allow manager
http_access deny CONNECT !SSL_ports
http_access deny !Safe_ports

visible_hostname mydomain.com
cache_effective_user squid
cache_effective_group squid

cache_peer 127.0.0.1 parent 8080 0 no-query originserver weight=1

cache_dir ufs /usr/local/squid/var/cache 5000 16 256
cache_log /usr/local/squid/var/logs/cache.log
access_log /usr/local/squid/var/logs/access.log
cache_store_log /usr/local/squid/var/logs/store.log
pid_filename /usr/local/squid/var/logs/squid.pid

cache_mem 2000 MB
cache_replacement_policy lru #The LRU policies keeps recently referenced objects

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern \js$ 1440 50% 4320
refresh_pattern \htm$ 1440 50% 4320
refresh_pattern \html$ 1440 50% 4320
refresh_pattern \jpg$ 1440 50% 4320
refresh_pattern \jpeg$ 1440 50% 4320
refresh_pattern . 0 20% 4320

logfile_rotate 6

In the browser test it by typing the url http://mydomain.com:8880 and look the response header information

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: