First install squid via apt-get or synaptic:
sudo apt-get install squidAfter installation, edit Squid's configuration file:
sudo gedit /etc/squid/squid.confIn the /etc/squid/squid.conf file, search and edit the following options/tags:
#TAG:http_port
http_port 3128
#OPTION WHICH AFFECT THE CACHE SIZE
cache_mem (1/4 of the your RAM) MB
(e.g. assuming your RAM is 1Gb then its "cache_mem 250 MB")
#LOGFILE PATHNAMES AND CACHE DIRECTORIES
#cache_dir ufs /var/spool/squid 100 16 256
cache_dir diskd /cache (capacity of your /cache in MB) 16 256
(make sure /cache already exists)
#RECOMENDED MINIMUM CONFIGURATION
acl netxxx src xxx.xxx.xxx.xxx/xxx.xxx.xxx.xxx
(specify your network and netmask e.g. "acl mynet src 192.168.0.0/255.255.255.0)
# AND FINALLY DENY ALL OTHER ACCESS TO THE PROXY
http_access allow netxxx
(e.g. "http_access allow mynet")
#TAG:Visible_hostname
visible_hostname (yourserver name)
#Then i just add these lines after the last lines of the configuration file
ie_refresh on
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
Save the file and then close.
At the terminal, change the ownership of /cache
sudo chown proxy:proxy /cacheThen create swap directories at /cache:
sudo squid -zThen fireaway squid!
sudo /etc/init.d/squid startYou may now follow the instructions on this blogpost for a transparent proxy using Ipkungfu.
To check if its working, open a web browser on a PC in your LAN and then do the following at the terminal :
sudo tail -f /var/log/squid/access.logEnjoy Squid!
P.S.: I am using Ubuntu LTS on a Pentium IV 1.7 Ghz 1Gb RAM 120 Gb HB PC.
2 comments:
Looking at the config, this is SQUID 2.5 or 2.6?
Just worth noting because I'm trying to get a setup to work using 2.7.
I don't dare go and install 3.0 to see how they're changed it again!
@Rich
This is for 2.5 then. Here's my config for squid 2.6. I now use CentOS 5.3 for my squid box. = http://teqnix.blogspot.com/2009/01/ipkungfu-nat-dhcp-server-transparent.html
Its pretty much the same, but easier. :)
Post a Comment