Squid Proxy: Basic Setup
Server Training - Proxy Server

Basic Squid Server Configuration

The complete configuration file is found at /etc/squid/squid.conf. However, since the Squid configuration file has over 3000 lines it is not the easiest to work with. A basic configuration of Squid only needs the modification of three lines.

First, it needs a visible hostname. So the line that contains the visible_hostname directive must be set to the server hostname.  This is the hostname that should be found in /etc/hosts.

visible_hostname myserver

The second line that must be set is to create a http_access variable that will allow users on the internal network to access the Internet. The line should look something like this:

http_access allow local_net

Now you will need to create an acl for the local_net that you describe in the above line. This should indicate the actual internal network that is connecting to the Squid box.The name of the acl is local_net, you can make this whatever you want but it must match the http_access name that you use.  The src indicates the source of the network.

acl local_net src

Save your configuration changes.

The next thing that must be done is that you need to create the cache for the proxy server. Run this command as root:

squid -z

Once this is complete start the Squid proxy.

service squid start


Basic Squid Client Configuration

The client on each machine that will use the squid proxy will need to be configured.  In the network settings you will need to place the IP Address of the proxy server and be sure to enter the port number that squid is listening on.  Here the proxy server is listening on port 3128.  Note that this proxy is used for all protocols, be sure to select that box.


Squid proxy