I find Squid to be very useful and have been disappointed that 3.1 is still not in any repositories. I googled a little to see if anyone has already done this, since reinventing the wheel is not really my thing. There are a couple tutorials/howtos, but I didn’t really like either approach. One approach uses the Debian packages, which is fine, but even those are already out date by a few revisions. Another howto I came across had a broken startup script which caused me about 15 minutes of headache before I just gave up on it.
So, I decided to install Ubuntu 10.04 server on a VM and do this from scratch from source. This is a default installation with no more than bringing the system fully up to date and installing openssh-server. I’m assuming you are logged in as a regular user and are in your home directory.
Off we go!
1. First thing to do is install all the necessary dependencies:
sudo apt-get install build-essential libldap2-dev libpam0g-dev libdb-dev dpatch cdbs libsasl2-dev debhelper libcppunit-dev libkrb5-dev comerr-dev libcap2-dev libexpat1-dev libxml2-dev libssl-dev pkg-config dpkg-dev curl
2. Get the file
wget http://www.squid-cache.org/Versions/v3/3.1/squid-3.1.8.tar.gz
3. Create the log directories
sudo mkdir /var/log/squid3
sudo chown -R proxy:adm /var/log/squid3
4. Create the cache directories and give them the correct permissions
sudo mkdir /var/cache/squid3
sudo chown -R proxy:proxy /var/cache/squid3
5. Build Squid 3.1
tar -xzf squid-3.1.8.tar.gz
cd squid-3.1.8
./configure –build=x86_64-linux-gnu –prefix=/usr –includedir=/usr/include –mandir=/usr/share/man –infodir=/usr/share/info –sysconfdir=/etc –localstatedir=/var –libexecdir=/usr/lib/squid3 –disable-maintainer-mode –disable-dependency-tracking –disable-silent-rules –srcdir=. –datadir=/usr/share/squid3 –sysconfdir=/etc/squid3 –mandir=/usr/share/man –with-cppunit-basedir=/usr –enable-inline –enable-async-io=8 –enable-ssl –enable-icmp –enable-useragent-log –enable-referer-log –enable-storeio=ufs,aufs,diskd –enable-removal-policies=lru,heap –enable-delay-pools –enable-cache-digests –enable-underscores –enable-icap-client –enable-follow-x-forwarded-for –enable-auth=basic,digest,ntlm,negotiate –enable-basic-auth-helpers=LDAP,MSNT,NCSA,PAM,SASL,SMB,YP,getpwnam,multi-domain-NTLM –enable-ntlm-auth-helpers=smb_lm –enable-digest-auth-helpers=ldap,password –enable-negotiate-auth-helpers=squid_kerb_auth –enable-external-acl-helpers=ip_user,ldap_group,session,unix_group,wbinfo_group –enable-arp-acl –enable-snmp –with-filedescriptors=65536 –with-large-files –with-default-user=proxy –enable-epoll –enable-linux-netfilter build_alias=x86_64-linux-gnu CFLAGS=”-g -O2 -g -Wall -O2″ LDFLAGS=-“Wl,-Bsymbolic-functions” CPPFLAGS= CXXFLAGS=”-g -O2 -g -Wall -O2″ FFLAGS=”-g -O2″
sudo make
sudo make install
I got the configure options from a doing a squid –v with a repository install. I had to change enable-ntlm-auth-helpers=SMB to enable-ntlm-auth-helpers=smb_lm.
6. The startup script references /usr/bin/squid3, the binary is just called squid. Fix that.
sudo ln -s /usr/sbin/squid /usr/sbin/squid3
7. Install the startup script to /etc/init.d/ and make it executable
wget https://www.guammie.com/donovan/files/2010/10/squid3
sudo mv squid3 /etc/init.d/
sudo chmod +x /etc/init.d/squid3
8. Have Squid start on boot
sudo update-rc.d squid3 defaults
And… here’s a configuration file I’ve used. Real basic, nothing fancy.
Just sudo /etc/init.d/squid3 restart and you should be good to go.
Here are the instructions in a text file in case any formatting is messed up.