Use apt-get or yum to install squid.
[root@server1 ~]# apt-get install squid3 [root@server1 ~]# yum install squid
Ensure Squid is set to automatically start after boot.
[root@server1 ~]# chkconfig squid on
Before we configure Squid, using any computer in our LAN, try to go to any website, such as www.google.com. Google's website should be displayed. Let's set up the client Web browser to send traffic through our Squid proxy server.
Chrome, Edge, or Internet Explorer
- Select the Windows Start icon > Control Panel.
- Select Internet Options.
- Select the Connections tab.
- Select LAN settings.
- Tick Use a proxy server and enter the IP address or hostname and port of the proxy server.
- Select Options.
- Select Advanced.
- Select Network.
- Select Settings.
- Select Manual proxy configuration, and enter the IP address or hostname and port of the proxy server.
Refresh www.google.com. The web browser will display a message such as The requested URL could not be retreived or The connection has timed out or Unable to connect to the proxy server.
By default, Squid is set to deny all HTTP traffic. Add the following in the /etc/squid/squid.conf or /etc/squid3/squid.conf file to allow every PC in the LAN to use the Squid proxy server. Replace x.x.x.x/xx with the network IP address, such as 192.168.0.0/24.
acl localnet src x.x.x.x/xx http_access allow localnet
Restart Squid, and ensure Squid is active and running.
[root@server1 ~]# systemctl restart squid [root@server1 ~]# systemctl status squid
If we go to www.google.com again, we will get Google's home page. Squid proxy server is now allowing HTTP traffic.