DansGuardian Installation + Configuration

Website: http://www.dansguardian.org
Version Used: 2.8.6
Download: http://dansguardian.org/?page=download2
Provides: Content filtering and blocking of sites, users, filetypes, etc.

Dans Guardian is a core component of the S4, and carries out many of the functions key to the S4. A lot of the settings you control from the web front-end relate back to Dans Guardian. This component provides the content filtering – scanning of the content requested for key words and phrases and filtering out anything deemed inappropriate. It can also block certain users or entire classes, block file types, prevent the downloading of certain files, etc.

It is actually recommended that you download a modified version of DansGuardian that includes built-in support for virus scanning and additional content filtering for Google Images searchs. To obtain this version, please head over to http://www.niesc.k12.in.us/linux/dansguardian/ to download the package by Adam Kennedy. In order for this version to work, you need to install some addtional packages before compiling DansGuardian:

apt-get install libclamav-dev clamav-freshclam libesmtp5 libesmtp-dev libtool libltdl3 libltdl3-dev

Answer the prompts whilst installing ClamAV as you see fit – ideally you want to enable it to run as a daemon, allow automatic updates, and restart the service automatically after updates have been applied. The rest of the DansGuardian compile now works exactly the same, although you will find a few additional configuration options in ‘dansguardian.conf‘. The default settings for the anti-virus scanning should be sufficient for most.

Before Dans Guardian can be setup, a new user and group need to be added to the Linux system in order to run the Dans Guardian service. A password will also need to be set for the newly created user:

useradd dansguardian
passwd dansguardian
groupadd dansguardian

As with the compilation of Squid, there are a number of configuration parameters that need to be included for Dans Guardian. If you have followed the recommendation of building your S4 from a base of Debian GNU/Linux then simply execute the following commands. If you have used another Linux distro as your base, please refer to the Knowledge Base and User Support Forums for additional compilation instructions if you are not sure of the paths you will need to enter:

make install
make clean

With Dans Guardian compiled, the ‘dansguardian.conf‘ file located in ‘/etc/dansguardian‘ will need to be ammended for our needs. Again, in a similar manner to editing the ‘squid.conf‘ file, there are a number of paramters available with the ‘dansguardian.conf‘ file, so work your through it and adjust the required settings:

filterip =
filterport = 3120
proxyip =
proxyport = 3127
usernameidmethodproxyauth = on
forwardedfor = off
usexforwardedfor = on

Once you have finished editing the ‘dansguardian.conf‘ file, you are ready to start up both the Squid and Dans Guardian services. Make sure you completed all the steps from the Squid configuration section before attempting to start Squid. In this instance, the first command creates all the Squid directories required for the cache and log files:

/usr/local/squid/sbin/squid รข��z

/etc/init.d/dansguardian start

That should be it! If you point a workstation to the IP address of your server with the port number set to 3127, you should find that you have web access. To view the logs running through on the server, the following Linux command displays real-time Dans Guardian access logs:

tail -f /var/log/dansguardian/access.log

Next Step: S4 Web Interface Installation

S4 Documentation Home

Leave a Reply

Your email address will not be published. Required fields are marked *


About Me

Iain Foulds, 32 years old. Originally from England, now living in Seattle, WA. I currently work as a Senior Content Developer for Microsoft writing about Azure VMs. Gamer. Very passionate about photography. Comments and opinions expressed here are my own. More...