Squid Proxy is among the easiest to compile through out my experience
in Debian. While I had difficulties to get a good and simple manual, I
struggled to compile my own and wrote this log as note for my own use.
In fact, I had been using squid 2.5.STABLE10 apt-get'ed from Ubuntu
but, looks like the developers ain't posting any updates for Breezy
anytime soon. Another reason that inspires me to grab the new stable
release is, the "Some small optimizations to reduce CPU usage" as
advertised in release page.
Squid 2.5.STABLE10 sure has drained and occupied a high CPU cycle from
time to time. Restarting the service doesn't help and pooling;
*sslReadServer read failed, AND
*Server is running out of File Descriptors (FD)
my Ulimit -n shows 1024. Raising to 4096 will reflect the same used in Squid. This has been taken care by the squid script
#portion of the script which relates to the raise. Adopted from /etc/init.d/squid
maxfds () {
[ -n "$SQUID_MAXFD" ] || return
[ -f /proc/sys/fs/file-max ] || return 0
[ $SQUID_MAXFD -le 4096 ] || SQUID_MAXFD=4096
global_file_max=`cat /proc/sys/fs/file-max`
minimal_file_max=$(($SQUID_MAXFD + 4096))
if [ "$global_file_max" -lt $minimal_file_max ]
then
echo $minimal_file_max > /proc/sys/fs/file-max
fi
ulimit -n $SQUID_MAXFD
}
I just hope things could be lot better with the Squid 2.6. Ya, just hope so...
Still need to be enlighted...
Sequence starts from here
#1 wget
http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE3.tar.gz (and extract the tarball)
#2 cd squid-2.6.STABLE3/
#3 ./configure
*Note: I'm currently using the default so you might wanna add the other prefixes...
*Maybe with these prefixes, you can override the one in Ubuntu
--prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin
--sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid
--localstatedir=/var/spool/squid --datadir=/usr/share/squid
--enable-async-io --with-pthreads --enable-storeio=ufs,aufs,diskd,null
--enable-linux-netfilter --enable-arp-acl
--enable-removal-policies=lru,heap --enable-snmp --enable-delay-pools
--enable-htcp --enable-poll --enable-cache-digests --enable-underscores
--enable-referer-log --enable-useragent-log
--enable-auth=basic,digest,ntlm --enable-carp --with-large-files
i386-debian-linux
#4 make all
#5 make install
#6 default installation prefix
/usr/local/squid/
#7 edit squid.conf
vi /usr/local/squid/etc/squid.conf
#8 seek "Access Control" and append at "#Recommended minimum configuration:"
acl allowed_hosts src 192.168.0.0/255.255.255.0
(in your case, change to your own subnet)
#9 append tag
http_access allow allowed_hosts
#10 check to see if another squid daemon is running
ps -C squid
#11 If previous Squid 2.5 Stable10 is installed and has a running pid, stop this old squid daemon
/etc/init.d/squid stop
#12 Executing squid for the first time, create swap space
/usr/local/squid/sbin/squid -z
#13 then, Execute squid as daemon
/usr/local/squid/sbin/squid
#14 just in case if squid writes to stderr
cat /usr/local/squid/var/logs/cache.log
OR,
/usr/local/squid/sbin/squid -N
(it had shown me errors without going thru the cache.log)
#15 configure your browser to use squid as proxy on default port 3128
#16 start browsing some website
#17 confirm activities at proxy
less /usr/local/squid/var/logs/access.log
(be expecting to see many TCP_MISS, then after some
time, revising the same URL, TCP_REFRESH_HIT will start populating)
#18 shutting down squid
/usr/local/squid/sbin/squid -k shutdown
well, I believe that there is ways to tweak the init.d and recycle the
squid scripts; changing the old path (/etc/squid) to a new.
OR, I'll be writing my own simple shell script. Either way, I need to continue my daily routine now...