Install and Configure SQUID Proxy Server on CentOS/ Linux

January 16, 2017

SQUID is a Proxy server and also used for web filtering.

Its used for increasing web server speed by caching repeated data.

1. Install Squid
Squid can be easily install using yum command line tool.
>> # yum install squid

2. Setup Port and Start Service
Squid by default run on port 3128. If we want to start squid on different port, so need to be Edit squid configuration file and change http_port value.
For example we are changing squid to run on port 8080.

After this process we need to start / restart the Squid service.

The squid package provides a proxy service for HTTP so we need to installed the HTTP service for the proxy server.
# yum install httpd -y

Allow access multiple user to access squid proxy from single ip or specific ip with username and password. For that we need to create a file to store passwords in it.
# touch /etc/squid/passwd

Change the ownership of Squid so Squid can access & by using below command as given below.
# chown squid /etc/squid/passwd

Use the htpasswd program to add users to the password file.
We can add users at anytime without having to restart Squid. In this case, we add a username called test:
# htpasswd /etc/squid/squid_passwd test
New password:
Re-type new password:
Adding password for user test
After this step we need to copy Squid file info.
# vi /etc/squid/squid.conf
Now we nee to restart the squid service by using below command
/etc/init.d/squid restart