Home > HowTo, Linux > SquidGuard 1.4 Howto

SquidGuard 1.4 Howto

February 6th, 2009 Leave a comment Go to comments
SquidGuard 1.4 Howto 3.3510

Howto setup SquidGuard 1.4
(check out my howto on SQUID)
Requirements:
* Bison
* Flex
* Berkeley DB V.2.7.7, V3.2.x or 4.x (original site: www.oracle.com/database/berkeley-db/index.html).
Annotation: Berkeley DB version 4.7 gives error messages during compilation. Up to version 4.6 the compilation runs fine.
* A C compiler like GCC
Lets start it:
# apt-get install bison flex
We also need the berkeley-db (recommend is version 4.6)
# wget http://www.xoroz.com/files/db-4.6.21.tar.gz
# tar -zxvf http://www.xoroz.com/files/db-4.6.21.tar.gz
cd db-46..
cd build_unix
../dist/configure –prefix /usr/local/BerkeleyDB
This will build the Berkeley DB library.
# make
To install the Berkeley DB library, enter the following command:
# make install
Update our library (debian)
# echo “/usr/local/BerkeleyDB/lib” >> /etc/ld.so.conf
# ldconfig
Confirm its there
# ldconfig -v | grep libdb-4
(After updating, I erased he entry from ld.so.conf)

Now we can download and install SquidGuard
# wget http://www.squidguard.org/Downloads/squidGuard-1.4.tar.gz
# tar -zxvf squidGuard-1.4.tar.gz
# cd squidGuard-1.4
# ./configure --with-squiduser=proxy (bu default it is: squid)
# make
# make install

Finally:

“Installing squidGuard
Done.
Installing configuration file
Created directory /usr/local/squidGuard/db
Assigned /usr/local/squidGuard/db to user proxy
Created directory /usr/local/squidGuard/log
Assigned /usr/local/squidGuard/log to user proxy
Copied sample squidGuard.conf
/usr/local/squidGuard/squidGuard.conf is now readable
The initial configuration is complete.
Congratulation. SquidGuard is sucessfully installed.”

Very important once you finish make sure you have this line in squid.conf:
redirect_program /usr/local/bin/squidGuard -c /usr/local/squidGuard/squidGuard.c
onf
like: redirect_program /squidGuard -c /squidguard.conf
Start squidGuard (will show output to stdout, also check .log for any errors):
# squidGuard -d

Install the Module into Webmin:

https://squidserver:10000

> Webmin > Webmin Configuration > Webmin Module > from Ftp or URl
"http://freshmeat.net/redir/squidguardwebminmod/15907/url_tgz/squidguard-0.91.2.wbm.gz"

ScreenShot http://www.niemueller.de/webmin/modules/squidguard/screenshots/mainpage.jpg

Download the blists and put the text version into the /db folder
Then Initiale the blacklists (convert text to .db)
# chown -R /usr/local/squidGuard/db/*
# squidGuard -C all

Appendix:
—-BerkleyDB
To rebuild Berkeley DB, enter:
# make clean
# make
If you change your mind about how Berkeley DB is to be configured, you must start from scratch by entering the following command:
# make realclean
../dist/configure
# make
To uninstall Berkeley DB, enter:
# make uninstall
—-SquidGuard
Installing the blacklists
Copy your blacklists into the desired blacklist directory (default: /usr/local/squidGuard/db) and unpack them. In the table below we assume that the default location is used. Make sure that you have the proper permissions to write to that directory.
# cp /path/to/your/blacklist.tar.gz /usr/local/squidGuard/db
# cd /usr/local/squidGuard/db
# gzip -d blacklist.tar.gz
# tar xfv blacklist.tar
Thru the webmin interface it is really easy to do most of the configuration
Config File Basic

dbhome /usr/local/squidGuard/db
logdir /usr/local/squidGuard/logs

dest porn {
domainlist porn/domains
urllist porn/urls
}

acl {
default {
pass !porn all
redirect http://localhost/block.html
}
}

More http://www.squidguard.org/Doc/configure.html
More http://www.maynidea.com/squidguard/faq-plus.html

Helpe Me out with just one simple click:
[ad]

Thanks

VN:F [1.7.5_995]
Rating: 3.3/5 (10 votes cast)
  1. Anton Ermakov
    March 24th, 2009 at 12:21 | #1

    You have an error is in the line:
    ../dist/configure –prefix /usr/local/BerkleyDB
    The right variant is:
    ../dist/configure –prefix /usr/local/BerkeleyDB

    UN:F [1.7.5_995]
    Rating: 3.3/5 (6 votes cast)
  2. xoroz
    March 24th, 2009 at 12:30 | #2

    THanks Anton, i fixed that line.

    UA:F [1.7.5_995]
    Rating: 3.0/5 (7 votes cast)
  3. April 9th, 2009 at 16:57 | #3

    thank you for you effort

    a up todate clear guide

    UN:F [1.7.5_995]
    Rating: 2.6/5 (9 votes cast)
  4. Abraham
    May 19th, 2009 at 00:45 | #4

    Hi Felipe, actually Iam runnig squid/3.0 STABLE14, all its OK, but with squidGuard I have the problem compiling BerkeleyDB.

    I followed this tutorial, for the setup of Berkeley DB (4.6), but squidGuard1.4 dont compiles all the db’s.

    Squid and SquidGuard are running over Mandriva Free 2009.1

    [root@localhost midi_squid]# echo “/usr/local/BerkeleyDB/lib” >> /etc/ld.so.conf[root@localhost midi_squid]# ldconfig
    [root@localhost midi_squid]# ldconfig -v | grep libdb-4
    ldconfig: Can’t stat “/usr/local/BerkeleyDB/lib”: No such file or directory
    ldconfig: Can’t stat “/usr/local/BerkeleyDB/lib”: No such file or directory
    ldconfig: Can’t stat “/usr/local/BerkeleyDB/lib”: No such file or directory
    libdb-4.6.so -> libdb-4.6.so
    libdb-4.7.so -> libdb-4.7.so
    [root@localhost midi_squid]# cd /usr/local/BerkeleyDB/lib
    [root@localhost lib]# ls
    libdb-4.6.a libdb-4.6.la libdb-4.6.so* libdb-4.so@ libdb.a libdb.so@
    [root@localhost lib]

    Could you help me please?
    Thank you.

    UN:F [1.7.5_995]
    Rating: 2.2/5 (6 votes cast)
  5. xoroz
    May 19th, 2009 at 09:26 | #5

    hey Abraham, I am sorry but I am not familiar with the Mandriva Free 2009.1.
    but you can probably find more help at the official site:
    http://www.oracle.com/technology/products/berkeley-db/index.html
    cheers,
    Felipe

    UA:F [1.7.5_995]
    Rating: 2.7/5 (3 votes cast)
  6. Abraham
    May 21st, 2009 at 16:13 | #6

    Thank you Felipe. I’ll try another things-

    UN:F [1.7.5_995]
    Rating: 4.0/5 (3 votes cast)
  7. Ramesh
    November 13th, 2009 at 23:59 | #7

    I followed the steps and I got the following error while running ./configure for squidguard installation.

    ** The Berkley DB library version 2.6.4 or newer
    is required. Get it from http://www.oracle.com
    use –with-db=DIR or –with-db-inc=DIR,
    –with-db-lib=DIR to specify its location
    (default is /usr/local/BerkeleyDB)

    Thanks,
    -Ramesh

    UN:F [1.7.5_995]
    Rating: 3.4/5 (5 votes cast)
  8. Renatux
    January 7th, 2010 at 10:26 | #8

    @Abraham
    Hi Abraham !

    You can compiling changing the:
    –with-db=/usr/local/BerkeleyXXX/lib
    to
    –with-db=/usr/local/BerkeleyXXX/

    *XXX is the version of BerkeleyDB
    You can just compiling only changing the /lib on the end of BerkeleyDB dir

    Regards,
    Renato

    UN:F [1.7.5_995]
    Rating: 4.5/5 (2 votes cast)
  1. March 1st, 2009 at 08:10 | #1