Step By Step Install Guide for
SquidGuard 1.2.0 and BerkeleyDB 3.29
Most of this is courtesy of Rick Matthews, as posted to
the mailing list.
First, install BerkeleyDB 3.2.9:
Download db-3.2.9 from here:
http://www.sleepycat.com/update/snapshot/db-3.2.9.tar.gz
Copy db-3.2.9.tar.gz to /usr/local/src
tar zxvf db-3.2.9.tar.gz
Download the two patches for 3.2.9 from here:
Patch #1
Patch #2
or from:
http://www.sleepycat.com/update/3.2.9/patch.3.2.9.html
(Save the patches to /usr/local/src/db-3.2.9)
Build and install BerkeleyDB:
cd /usr/local/src/db-3.2.9
(The 'pwd' command should show /usr/local/src/db-3.2.9)
patch -p0 < patchdb.3.2.9-1
patch -p0 < patchdb.3.2.9-2
cd build_unix
../dist/configure
make
make install
cd ../..
echo /usr/local/BerkeleyDB.3.2/lib >> /etc/ld.so.conf
ldconfig
Build and install squidGuard
Copy squidGuard-1.2.0.tar.gz to /usr/local/src
cd /usr/local/src
tar zxvf squidGuard-1.2.0.tar.gz
Build and install squidGuard
cd /usr/local/src/squidGuard-1.2.0
export LIBS="-lpthread"
./configure \
--prefix=/usr/local/squidguard \
--datadir=/usr/share \
--sysconfdir=/etc \
--localstatedir=/var \
--infodir=/usr/info \
--mandir=/usr/man \
--with-sg-config=/etc/squidguard.conf \
--with-sg-logdir=/var/log/squidguard \
--with-sg-dbhome=/var/lib/squidguard \
--with-db=/usr/local/BerkeleyDB.3.2
make
make install
Set up the page to redirect users
to when they're blocked:
Download a modified .cgi file here:
squidGuard.cgi
Save it into your web server's cgi-bin directory
Download an "invisible" gif file
here:
1x1.gif
Save it into your web server's
"icons" or "images" directory
Set up other files and
directories
Modify squid.conf:
Find the line
which contains "redirect_program" and change it to:
redirect_program /usr/local/squidguard/bin/squidGuard
Find the line which
contain "cache_effective_user" and "cache_effective_group"
Note what the
user and group for squid are (normally = "squid")
Create the log directories and files
mkdir /var/log/squidguard
touch /var/log/squidguard/squidGuard.log
touch /var/log/squidguard/ads.log
touch /var/log/squidguard/stopped.log
This next line depends upon what
"cache_effective_user" and "cache_efffective_group"
are set to in squid.conf:
chown -R squid.squid /var/log/squidguard
Create the squidguard.conf file; you can download
mine from:
squidguard.conf
Save it into your web server's /etc directory
Get your db files if not upgrading:
Download the automatic updater script:
getlists.sh
Save it to the /usr/local/squidguard/bin
directory. If your squid user or group, or any of your file locations are
different, you will have to edit the script to adapt it for your system.
Run the script:
. /usr/local/squidguard/bin/getlists.sh
Wait
for it to complete. You can add "getlists.sh" to your favorite
cron list so this will happen automatically in future.
Restart your squid process.
For upgraders: The .db files created with BerkeleyDB 2.x cannot be used with
BerkeleyDB 3.
If you are using the prebuilt .db files, rm *.db and do a "squidGuard -d -C
all"