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
cd db-46..
# tar -zxvf http://www.xoroz.com/files/db-4.6.21.tar.gz
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
You have an error is in the line:
../dist/configure –prefix /usr/local/BerkleyDB
The right variant is:
../dist/configure –prefix /usr/local/BerkeleyDB
THanks Anton, i fixed that line.
thank you for you effort
a up todate clear guide
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.
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
Thank you Felipe. I’ll try another things-
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
@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
@Abraham
compile new BerkeleyDB or recreate shortcut to lib file.
Regards,
“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.conf”
Actually, this works for Squid versions 2.5 and below, but not for 2.6 and abobe…you should use “url_rewrite_program” instead of redirect_program.
And then there is a problem with SquidGuard Webmin module…if there is no redirect_program line in squid.conf he reports that “Squid not configured”and adds “redirect_program…” line in squid.conf… 🙁
mIRO
I had the same problem. As you said, this works for squid versions 2.5 and below. Thats why squidguard webmin module is tries to find the line redirect_program, and it says squid is not configured to use squidguard as a redirector.
I think I have a workaround for this problem. You shoul change some cgi files that Squidguard module uses to check and change squid configuration.
first, look for arm_squid.cgi, index.cgi and index2.cgi files. They should be in /usr/share/webmin/squidguard or /usr/libexec/webmin/squidguard directory, depending the distribution you’re using.
inside arm_squid.cgi look for the lines:
local $dir = { ‘name’ => ‘redirect_program’, ‘values’ => [ $squidguard_command ] };
&foreign_call(‘squid’, ‘save_directive’, $squidconf, ‘redirect_program’, [ $dir ]);
change redirect_program for url_rewrite_program
inside index.cgi and index2.cgi llok for the lines:
my $directive = &foreign_call(‘squid’, ‘find_config’, ‘redirect_program’, $squidconf);
change redirect_program for url_rewrite_program
With these changes squidguard module for webmin should work fine
Hope this can help you
Best regards,
Alex
P.D: Sorry for bad english
alex i need more help about squidguard i had configured squid on redhat linux it work fine when i install squid guard it run,but when i change squidguards.conf file squid stop
Hello.
I am junior system administrator. Currently I am working on squid proxy and squid guard. Because I did not have experience with opensuse platform, It became difficult for me.
So I hope it will be easy for me in the next (squid and Squid guard).
Just you can share me any thing important to me.
Best Regards,
Josi
I am not really computer savvy. I have never downloaded squidguard. How do I remove this from my computer? I can be emailed at renitamac@yahoo.com
I have found the installation problem of squid guard,
I followed the tutorial and fixed it, the issue was the environmental variable of BerkelyDB
https://groups.google.com/forum/#!topic/comp.unix.solaris/8Q-nhszThY4
run configure with appropriate environment parameters, i.e.
LDFLAGS=’-R/usr/local/BerkeleyDB/lib’ ./configure …
or with
export LD_RUN_PATH=/usr/local/BerkeleyDB/lib
./configure …
make …
The run path has always to be set explicitly for the configure
scripts.
Thankx!
Basit Khan
http://www.basitkhan.info