====Welcome==== This is the fourth project for HPC0. I will be detailing the fundamentals of the Squid proxy software. ====Why Squid?==== Squid is an opensource proxy server with high functionality; the administrator has a great deal of control over how his proxy server will operate. For instance, let's say you want trafic from separate ports to redirect when making an external connection, all you need to do is establish what ports squid will listen to in the squid.conf file. Transparency is possible meaning the proxy server essentially becomes a secure internet gateway and the administrator can also allocate a cache size of his choosing for small or large scale deployments. So now that you know the sheer awesomeness of squid and I'm sure you're aching to get started, lets gather our needed materials... ====Materials==== - One up-to-date Linux box with a distro of your fancy. - An updated package manager. - A strong will that yearns to be God of packet redirection. ====Atributes==== Shared Network service, Two stars. ====procedure==== This procesure will assume you're using arch linux for your setup. The only differences will be the installation via your package manager. - Update your package manager: sudo pacman -Syu - Download and install squid: sudo pacman -S squid - Navigate to /etc/squid - Now squid is well documented but there is a lot to read. If you believe the documentation is unnecessary you can remove it all by typing the following: sed -i "/^#/d;/^ *$/d" /etc/squid/squid.conf - for our proxy we'll be initializing a transparent setup that assumes you're on a home network. - coping the following config from the cat result into /etc/squid/squid.conf [andrew@PogoLab squid]$ cat squid.conf acl ip_acl src 192.168.1.0/24 http_access allow ip_acl http_access allow all cache_mgr asow123@gmail.com cache_mem 64 MB cache_dir diskd /var/log/squid/cache0 64 16 256 cache_effective_user andrew http_port 80 transparent http_port 3128 transparent [andrew@PogoLab squid]$ create your cache directory here: /var/log/squid/cache0 and set the permitions so everything can write: sudo chmod 777 /var/log/squid/cache0 - save the config and start the service: [andrew@PogoLab squid]$ sudo rc.d start squid :: Creating squid's swap directories [BUSY] 2012/04/24 11:50:33| Creating Swap Directories 2012/04/24 11:50:33| /var/log/squid/cache0 exists 2012/04/24 11:50:33| /var/log/squid/cache0/00 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/00 2012/04/24 11:50:33| /var/log/squid/cache0/01 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/01 2012/04/24 11:50:33| /var/log/squid/cache0/02 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/02 2012/04/24 11:50:33| /var/log/squid/cache0/03 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/03 2012/04/24 11:50:33| /var/log/squid/cache0/04 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/04 2012/04/24 11:50:33| /var/log/squid/cache0/05 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/05 2012/04/24 11:50:33| /var/log/squid/cache0/06 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/06 2012/04/24 11:50:33| /var/log/squid/cache0/07 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/07 2012/04/24 11:50:33| /var/log/squid/cache0/08 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/08 2012/04/24 11:50:33| /var/log/squid/cache0/09 exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/09 2012/04/24 11:50:33| /var/log/squid/cache0/0A exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/0A 2012/04/24 11:50:33| /var/log/squid/cache0/0B exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/0B 2012/04/24 11:50:33| /var/log/squid/cache0/0C exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/0C 2012/04/24 11:50:33| /var/log/squid/cache0/0D exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/0D 2012/04/24 11:50:33| /var/log/squid/cache0/0E exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/0E 2012/04/24 11:50:33| /var/log/squid/cache0/0F exists 2012/04/24 11:50:33| Making directories in /var/log/squid/cache0/0F :: Starting squid [DONE] [andrew@PogoLab squid]$ Make sure your router can forward the ports you've set for your configuration. Set your network preferences to point at the ip of the proxy server and you're in business baby! ====afterthoughts==== So now that you have your squid up and swimming around your network you may ask yourself: how did I get here? and you may tell yourself: /etc/squid/squid.conf You can always go back and change your config for separate solutions. ====Thanks for playing====