Running Squid
Why Use Squid?
When you're at work, the machines you use may need to get access to the internet
indirectly, via a firewall machine or an http proxy server (let's call this machine
firewall_proxy_server).
To save folks from having to go through the same trial and error with setting up Squid, I wrote up
the following summary of the configuration for this scenario of using Squid to cache files
downloaded via a firewall machine or http proxy server.
Configuring Squid
I found the following are the main settings needed to get Squid to listen for
http requests on its default port
3128, and forward them to port
80 on the
machine
firewall_proxy_server, while keeping a cache of everything
it retrieves in the directory
/somewhere/with/space/squid_cache/
(configured with size 16384 megabytes), while allowing access from clients
in the three subnets listed in the
our_networks access control list:
Settings in configuration file /etc/sqlid/squid.conf
cache_peer firewall_proxy_server parent 80 3130 default no-query
cache_dir ufs /somewhere/with/space/squid_cache 16384 16 256
cache_access_log /somewhere/with/space/squid_cache/access.log
cache_log /somewhere/with/space/squid_cache/cache.log
cache_store_log /somewhere/with/space/squid_cache/store.log
acl our_networks src 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24
http_access allow our_networks
httpd_accel_host firewall_proxy_server
httpd_accel_port 80
httpd_accel_single_host on
httpd_accel_with_proxy on
To get squid going initially, you need to first install the package:
apt-get install squid
If it's not already done, to initialize the squid cache
cache_dir
you may need to run as root:
squid -z
Then start squid using:
invoke-rc.d squid start
To get squid to re-read its configuration file, use:
squid -k reconfigure
You might need to do this for example if you want to change the settings while squid is running, e.g. to
increase the size of the squid disk cache (
cache_dir third parameter).
--
PeterKnaggs - 10 Dec 2004
to top