What is squid?
Many of you are using Squid without even knowing it! Some companies have embedded Squid in their home or office firewall devices, others use Squid in large-scale web proxy installations to speed up broadband and dial up internet access. Squid is being increasingly used in content delivery architectures to deliver static and streaming video/audio to internet users worldwide.
Squid is a Unix-based proxy server that caches Internet content closer to a requester than its original point of origin. Squid supports caching of many different kinds of Web objects, including those accessed through HTTP and FTP. Caching frequently requested Web pages, media files and other content accelerates response time and reduces bandwidth congestion.
It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL.
Squid optimizes the data flow between client and server to improve performance and caches frequently-used content to save bandwidth. Squid can also route content requests to servers in a wide variety of ways to build cache server hierarchies which optimize network throughput.
Squid offers a rich set of traffic optimization options, most of which are enabled by default for simpler installation and high performance.
- For ISPs: Save on bandwidth, improve user experience : Squid allows Internet Providers to save on their bandwidth through content caching. Cached content means data is served locally and users will see this through faster download speeds with frequently-used content.A well-tuned proxy server (even without caching!) can improve user speeds purely by optimising TCP flows. Its easy to tune servers to deal with the wide variety of latencies found on the internet – something that desktop environments just aren’t tuned for.
- For Websites: Scale your application without massive investment in hardware and development time : Squid is one of the oldest content accelerators, used by thousands of websites around the world to ease the load on their servers. Frequently-seen content is cached by Squid and served to the end-client with only a fraction of the application server load needed normally. Setting up an accelerator in front of an existing website is almost always a quick and simple task with immediate benefits.
- Squid makes it easy for content distributors and streaming media developers to distribute content worldwide. CDN providers can buy cheap PC hardware running Squid and deploy in strategic locations around the internet to serve enormous amounts of data cheaply and efficiently.
Installation of squid proxy server
# yum install squid
Squid Basic Configuration
Squid configuration file located at /etc/squid/squid.conf.
# vi /etc/squid/squid.conf
At least you need to define ACL (access control list) to work with squid. The defaults port is TCP 3128.
Following example ACL allowing access from your local networks 192.168.2.0/24 and 192.168.3.0/24. Make sure you adapt to list your internal IP networks from where browsing should be allowed:
acl our_networks src 192.168.2.0/24 192.168.3.0/24
http_access allow our_networks
Save and close the file. Start squid proxy server:
# chkconfig squid on
# /etc/init.d/squid start
Make sure iptables is allowing to access squid proxy server. Just open /etc/sysconfig/iptables file:
# vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state –state NEW,ESTABLISHED,RELATED -m tcp -p tcp –dport 3128 -j ACCEPT
Restart the firewall service
# service iptables restart
Open a web browser > Tools > Internet option > Network settings > and setup Squid server IP address and port # 3128.
For any query or issue, feel free to discuss on http://discuss.eduguru.in
In the next article we will learn about advance squid proxy.