webdnstools.com
DNS Lookup, Reverse DNS Lookup, Domain Configuration Check and IP Address Calculators

How to Install Squid Proxy Server

Squid is a caching web proxy server which is free to use. This article explains how to install it on Linux systems. Once installed, the configuration directives should be common between different operating systems. Squid also supports proxy authentication. For details on how to enable proxy authentication, refer to the related article on this website.

Install Squid

Install Squid (if not already installed). If you're using Redhat, Centos or Fedora you can install Squid using yum:

yum install squid.x86_64

If you're using Debian or Ubuntu, you can install squid using the apt-get command:

apt-get install squid

For other operating systems, Squid can be downloaded from the Squid website: http://www.squid-cache.org/.

Set the Squid service to start automatically on system start. If you're using Redhat, Centos or Fedora you can set this using the chkconfig command:

chkconfig squid on

If you're using Debian or Ubuntu, you can set the Squid service to start using the update-rc.d command:

update-rc.d squid defaults

Configure Squid

Open the squid configuration file, which on Linux should be in the following location:

/etc/squid/squid.conf

By default Squid listens on port 3128. If you want Squid to listen on a different port, for example port 8080, locate the http_port directive and set it to 8080, as follows:

http_port 8080

Note: If you're running a local firewall (eg. iptables), make sure your firewall allows incoming connections on this port!

You can set the name of your proxy server in the conf file using the visible_hostname directive:

visible_hostname proxybau

By default Squid passes through the IP address of the client machine in the HTTP headers. To turn of this feature set the following directives in the conf file:

forwarded_for off

Save the configuration file.

We are now ready to start Squid. If Squid is already running, reload the configuration file by running the following command as the root user:

squid -k reconfigure

If squid is not already running, start it by running the following command as the root user:

/etc/init.d/squid start