Setup SquidIf you want to set up your own proxy on your home computer you are able to do it by using Squid. Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages.

Why would you want to use Squid?

Why would you set up your own proxy on the home computer? Here are several reasons:

  • If you travel abroad and you want to browse the Internet as you were home with no restrictions.
  • Do you want to help people that are located in countries like Iran, UAE, Thailand, etc. by allowing them to access restricted sites via your computer?
  • If you want better performance when browsing your frequently-visited sites.
  • If are about to get shaped and want to reduce your quota consumption.

Install Squid on Windows

1. Download Squid for Windows
2. Extract that zip archive, and move the “squid” folder to the root of your drive (probably C:\).
3. After moving the squid folder, open “C:\squid\etc\squid.conf” in your favorite text editor (not Word).
4. Configure the DNS name servers on the line that says “dns_nameservers” to point at your ISPs DNS servers.
5. You should lock the access to only certain IP addresses.

Inside the text editor search for the line “http_access deny all” and change it to “http_access allow all“. This will make your proxy open and accessible to the world. If you would like to limit your proxy to certain IP blocks, change “http_access deny all” to “http_access allow TRUSTED“. Add a line (BEFORE the http_access line to set up an access control list [ACL]). This ACL line that defines TRUSTED IPs should be:

acl TRUSTED src xx.xx.xx.xx yy.yy.yy.yy zz.zz.zz.zz

where xx.xx.xx.xx, yy.yy.yy.yy and zz.zz.zz.zz are allowed IP addresses.

6. Setup “visible_hostname” (normally just the public IP address).
7. Turn off logging by adding these two lines:

access_log none
cache_store_log none

8. Setup the Squid cache by issuing the following command: “c:\squid\sbin\squid -D –z” (No quotes).
Setup Squid to run as a service by issuing the following command: “c:\squid\sbin\squid –i”.

Install Squid on Linux

If you’re using CentOS/Redhat, it’s pretty straightforward to set up a proxy.

Login as root and run the following

yum install squid
nano -w /etc/squid/squid.conf

Setup the trusted IP addresses in the same way as for Windows.

Turn off logging by adding these two lines:

access_log none
cache_store_log none

Save the config file and as root issue the following command to start the Squid proxy server:

service squid start

Important!

You should not run Squid on a machine that you’re worried about or is used for production. Make sure you take basic security precautions, like moving FTP off the default port, using a firewall, etc.

Did you set up your own proxy? What are you using it for? Share your thoughts in the comments below.