How to install and configure Squid Proxy Server

Home > Search > How-to
  by

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

  1. Select the Windows Start icon > Control Panel.
  2. Select Internet Options.
  3. Select the Connections tab.
  4. Select LAN settings.
  5. Tick Use a proxy server and enter the IP address or hostname and port of the proxy server.

Firefox

  1. Select Options.
  2. Select Advanced.
  3. Select Network.
  4. Select Settings.
  5. 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

 

Allow HTTP and HTTPS traffic in iptables.

If we go to www.google.com again, we will get Google's home page.  Squid proxy server is now allowing HTTP traffic.

 

 

 

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments