this is obsolete doc -- see http://doc.nethence.com/ instead

Squid tutorial 

 

 

Configuration 

Prepare the system, 

mv /var/spool/squid /var/spool/squid.dist
mkdir /cache
chown squid:squid /cache
chmod 750 /cache

 

Prepare the file, 

mv /etc/squid/squid.conf /etc/squid/squid.conf.dist
sed '/^#/d;/^$/d' /etc/squid/squid.conf.dist > /etc/squid/squid.conf
chown root:squid squid.conf
chmod 640 squid.conf

 

Edit the file (vi /etc/squid/squid.conf) like, 

http_port INTERNAL_IP:8080
visible_hostname HOSTNAME
cache_mgr email@example.com
cache_dir ufs /cache 2048 16 256
cache_effective_user squid
cache_mem 16 MB
#debug_options ALL,9
...
acl ACL_EXAMPLE src 10.0.0.0/255.255.255.0
http_access allow ACL_EXAMPLE
...
coredump_dir /cache

Note. cache_mem is for RAM but cache_dir here defines 2GB. 

Note. use cache_peer for neighboor squid servers. 

 

 

Ready to go 

Initialize, start and watch the logs, 

squid -z
service squid start
chkconfig squid on
tail -F /var/log/messages /var/log/squid/* &

 

Check it's working, 

- configure your desktop browser to point to that squid server 

- try to access some web site 

- try twice to download a <4MB archive (validate the cache) : http ://ftp.club-internet.fr/mirrors/ftp.openssl.org/snapshot/ 

Note. no space between "http" and "://" 

- try FTP 

- try HTTPS 

 

 

References 

Squid Home : http://www.squid-cache.org/ 

SquidGuard Home : http://www.squidguard.org/