[squid-users] Building squid | Best Practices?

Amos Jeffries squid3 at treenet.co.nz
Sun Aug 30 00:30:58 UTC 2015


On 29/08/2015 12:52 p.m., Howard Waterfall wrote:
> Ubuntu 14.04
> 
> Squid 3.5.5
> 
> Hi -
> 
> I've successfully installed, configured and run squid 3.5.5 w/o a problem
> using:
> 
> sudo apt-get install squid
> 
> I want to filter by mac address though, so I purged that install and
> re-built squid with the *--enable-arp-acl* flag. I installed using make
> install.
> 

It seems the documentation is outdated. EUI support is built into
current Squid by default.

Note however that ARP and MAC/EUI-48 is an IPv4-only feature and does
not work on complex networks anyway due to how ARP operates. IPv6 uses
other mechanisms to route packets.


> This is when the problems begin. I've summarized that in a separate thread:
> 
> http://lists.squid-cache.org/pipermail/squid-users/2015-August/005232.html
> 
> I wonder if there's a way to simply *avoid* all those problems.

There is. At least its "simple" for someone used to custom building.


step 1) Purge your custom build and reinstall the distro package.

If this is just for the ARP. That should be enough.


If you want other custom features continue with ...

step 2) run "apt-get build-dep squid" to install the packages needed to
build squid yourself.

step 3) Use "squid -v" to identify the system-specific build options.


If you build Squd now with the options straight from -v the "make
install" step will replace the existing package files with updated copies.

Note that Upgrading the system package later will in turn replace your
custom build in the same way. So this is mostly useful for custom builds
to fix/patch temporary bugs you expect the system package to fix later.
Or if you use aptitudes 'hold' feature.

But, there are more steps below..

> 
> A couple of questions:
> 
> 
>    1. My build configuration is below. After building and installing, squid
>    ended up here: */usr/local/squid/sbin*. I think that's the same place *sudo
>    apt-get install squid *puts it right?

That /usr/local is the default location for user-built programs in *NIX
and *BSD operating systems. System provided packages go elsewhere.

Debian/Ubuntu has a different package layout as well. The squid -v step
above will provide you with the build options needed to setup for that
layout properly.



>    2. Given I had no problems with *sudo apt-get install squid*, is the
>    best practice to install squid using that method and arrange for my builds
>    to install squid to a different location and simply copy it over?


If you just want to keep the Squid installation separate from the system
package. Then the FS layout does not matter. Just...


> 
> Thanks,
> 
> Deiter
> 
> ./configure --prefix=/usr --localstatedir=/var
> --libexecdir=${prefix}/lib/squid3 --srcdir=.
> --datadir=${prefix}/share/squid3 --sysconfdir=/etc/squid3
> --with-default-user=proxy --with-logdir=/var/log
> --with-pidfile=/var/run/squid.pid --enable-arp-acl
> 


step 4) run "mkdir /proxy" (or whatever you want to call it)

step 5) change that --prefix option to /proxy

The "make install" should then create everything which makes up "Squid"
inside /proxy.

step 6) edit the /etc/init.d/squid script DAEMON= and CONFIG= variables
to point at your custom /proxy/sbin/squid and /proxy/etc/squid/squid.conf


The system package upgrades will then not affect your customizations.


Thats how I do it anyway :-)

Amos


More information about the squid-users mailing list