CentOS 6 Squid Proxy Install

Today Mama is going to cook a tasty Squid proxy server on CentOS 6. It’s a reliable, trusted solution used in many web filtering appliances around the world. This howto comes with no guarantees!

Install Squid.

yum install epel-release && yum -y install squid

These are very common forward proxy settings.

vi /etc/squid/squid.conf

acl CONNECT method CONNECT <<– look for this line
## Add a new ACL to allow your LAN access to the Proxy:
acl lan src

http_access allow localhost <<– look for this line
## Let the ACL we just defined have http access via the proxy and add/change to:
http_access allow lan

## Look for http_port and change it to:
http_port 8080

## Copy and paste the below to the bottom of the file:
request_header_access Referer deny all
request_header_access X-Forwarded-For deny all
request_header_access Via deny all
request_header_access Cache-Control deny all

## Look for visible_hostname
visible_hostname yourhost.server.world

## Turn off IP address forwarding:
forwarded_for off

Exit vi (:x), turn on the Squid service at boot and start the service now:
chkconfig squid on
service squid start

Welcome to Mama Linux!

Here we’ll try to provide you with the tastiest Linux recipes that only Mama can provide! We’ll be aiming to help you set up a few different services running on Linux, helping you over any sticking points.