To install squid on CentOS, use yum install command (you must be logged in as root (If you’re not familiar with yum and root access, you might want to check the following topic first: 15 most used linux commands and how to use them)):
cd squid -*
Now enter the following commands in order to configure, compile and install squid
This by default, will install it in “/usr/local/squid”.
Type ./configure –help to view all available options.
In order to configure squid, we open the squid configuration file located in /etc/squid
By default, squid will listen on port 3128, to make it listen on port 3128, 8080 and port 2083, we add the following:
or if you want to define an IP to listen to instead of all IPs, replace YOUR_SERVER_IP by your server IP:
To allow everyone to access and use the proxy server, append the following line to the configuration file:
(make sure to remove the line http_access deny all for the above to work)
To allow a range of IPs instead of allowing everyone, add the following command
http_access allow my_ranged_ips
http_access deny all
Once the configurations are done, restart squid:
To stop squid
To start squid
Any comments, questions or suggestions? Post below!