How to setup Squid Proxy server On centos7

Published by blogger on

Squid is a proxy server available on various Linux distributions. it can be used to perform various tasks.

  1. Restrict internet usage
  2. Save Bandwidth on local network
  3. Implement security
  4. cache content to save bandwidth.

in this tutorial we will demonstrate how to install and configure squid proxy server on centos7.

Step1: Update your Operating System.

Step2:

Istall Epel-repository.

Step3:

install squid and respective binaries.

once squid is installed, we will backup the squid configuration file as we would need to edit and alter few settings as per our requirements.

Step4:

Step5:

Edit the configuration file make the below changes.

Setup http_port directive. By default squid listens on 3128. You can always set it to a different port such as 8080. for the easiness we would keep it as 3128 ( the default port).

uncomment the cache_dir directive. THis directive is used to store your cached content that is passed through squid.

Step6: Define Cache size.

Define cache size directive above the cache dir. You can always choose the size of the cache based on the available disk space on your proxy server.

Step7: Define cache patterns at the end of the  file.

 

Save the file and close.

 

Step8: Open Firewall ports for squid to work.

Step9: Reload Firewall.

Step10: Enable and start Squid

From your linux server you can set http_proxy variables to route traffic through squid.

Step11: Verify Squid logs.