All for Joomla All for Webmasters

SQUID – Installation on CentOS, Fedora and Red Hat

SQUID – Caching Proxy Server Installation

Squid is a proxy server and web cache daemon. It has a wide variety of uses, from speeding up a web server by caching repeated requests; to caching web, DNS and other computer network lookups for a group of people sharing network resources; to aiding security by filtering traffic.Squid is available with major Linux distributions like CentOS, Fedora and Red Hat.

To install Squid

# yum install squid -y

Configure Squid after installation.

# vim /etc/squid/squid.conf
visible_hostname linuxarticles.squid

Save and exit the file.

Restart Squid Service by executing,

# service squid restart

Use your local squid proxy server ip address & port 3128 (default port for SQUID) to configure internet clients. While accessing internet you’ll get error Access Denied.

To allow internet access to your local users,

# vim /etc/squid/squid.conf

acl MyComp src
http_access allow MyComp

Save and exit the file.

Don’t Miss to Read

LAMP Linux | Installation of LAMP on Linux Server

To allow all internet sites, blocking few e.g social networking sites.

# vim /etc/squid/squid.conf

acl MyComp src
acl deniedsites url_regex “/etc/squid/denied” #list of the sites blocked
http_access deny MyComp deniedsites #to block ban sites
http_access allow MyComp

Save and exit the file.

To disabled caching for specific sites, you might require to disable caching for few sites.

# vim /etc/squid/squid.conf

acl sites url_regex “/etc/squid/nocache”
no_cache deny sites

Save and exit the file.

To configure Transparent proxy,

# vim /etc/squid/squid.con

http_port transparent # squid local ip address


http_port 3128 transparent

Save and exit the file.

Transparent proxy is used when you do not wish to define proxy settings in clients terminal, for that you need to do port redirection using iptables over gateway.

# iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 3128

# service iptables save;

SQUID – Installation on CentOS, Fedora and Red Hat

log in

Become a part of our community!

reset password

Back to
log in
Choose A Format
Personality quiz
Trivia quiz