Installing and Configuring Squid Proxy Cache Server

Squid is a proxy caching server. You can use squid in effective way, so that you can control the internet access over your network.

In Fedora, you can install the squid proxy cache server by just typing the following command, its available in the fedora main repo itself.

$ sudo yum install squid

Before starting the squid server you need to configure it with the help of this configuration file in ‘/etc/squid/squid.conf’.

In this scenario, I have a proxy server running in background which will respond to specific ip’s (LAN) and forward to a defined gateway. Using the gateway, all the hosts from my all LAN can reach internet.

What my system (proxy server) has to do is, to listen in a specified port ‘3128’ and forward the requests to the gateway.

My Gateway : 10.2.4.85
My IP Address : 192.168.1.4

Add the following things to that ‘squid.conf’ :
>>
acl localnet src 192.168.1.0/24
http_access allow localnet
http_port 3128
<>
acl RestrictedSites dstdomain “/etc/squid/restricted_sites”
http_access deny RestrictedSites
<<

#cat /etc/squid/restricted_sites
facebook.com
orkut.com
twitter.com
youtube.com

Advertisements