Learn How To Install Squid Proxy on CentOS

July 12, 2019

Table of Contents

Squid is a popular, free Linux program that allows you to create a forwarding web proxy. In this guide, you’ll see how to install Squid on CentOS to turn your server into a web proxy.

Squid can be configured as a reverse proxy as well, but that type of setup is not covered in this article.

This guide was written for CentOS 6, but should also work for CentOS 7.

Step 1: Installing Squid

I’m going to assume that you have a new CentOS server. You can now install Squid with yum:

yum install squid

Step 2: Editing configuration

You can now configure Squid. The configuration file is located at the following path:

vi /etc/squid/squid.conf

Open this file with your favorite text editor in order to configure Squid settings. You can find an overview of them on the official Squid website.

Step 3: Open port in firewall

Now open the Squid port in the firewall. The default port is 3128. If you changed it, naturally, open the port you set Squid to run on:

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3128 -j ACCEPT

Step 3: Restarting service

You can now restart the Squid service:

service squid restart

To make Squid start every time you start your server, use chkconfig:

chkconfig squid on

In order to see your users’ activity, you can use the tail command to read the logs:

tail -f /var/log/squid/access.log

Step 4:

https://www.itweb.services/tutorials/linux-guides/connecting-to-a-proxy-from-os-x-windows-and-linux”>this guide.

Need help?

Do you need help setting up this on your own service?
Please contact us and we’ll provide you the best possible quote!