DansGuardian log analyzer

There are two options :
a) Webmin+DG module
b) dglog2 Perl script

If we are using dglog2
Starting conditions : functional Squid and DG, working Apache, Perl.
1. Check up if DG is rotating his own log /var/log/dansguardian/access.log
1a. In /etc/httpd/httpd.conf check if exists :
LoadModule cgi_module modules/mod_cgi.so
Also check where cgi-bin is :
ScriptAlias /cgi-bin/ “/var/www/cgi-bin/”
And unhash the line :
AddHandler cgi-script .pl
2. Make folder /ApacheDocumentRoot/dglog2 and put the script there :
# wget http://dansguardian.pl/pobierz/dglog2.pl
3. Change dglog2.pl :
Unhash and set up in accordance with the present state :
$cgipath = ‘’;
Hash :
#$cgipath = $ENV{SCRIPT_NAME};
4. File ownership and rights :
-rwxr-x— 1 apache apache 26280 Dec 13 14:23 dglog2.pl
5. Change in /etc/httpd/conf/httpd.conf :
Since strange things happen when I try to show changes in httpd.conf file, I am putting them here as a picture :
And all will work.
6. Test in local :
# ./dglog2.pl access.log-11Decembar2013 >index.html
I admit I am NOT delighted with the result……

Post with some instructions : post.

If we use Webmin+DG module
1. Check if you have a Webmin installed, if not, do yum etc…..
# rpm -qa|grep webmin
2. Check if it is started up :
# service webmin status
Webmin (pid 6019) is running
3. How to access it :
Startup login is set up to be root/your-root-password
4. Installation of DG module for log analysis :
Download Webmin DG module from here, and then :
Login to Webmin
Click on “Webmin” menu category
Click “Webmin Configuration”
Click “Webmin Modules”
Click “From local file”
Click “Install Module”
After this go to Servers/DansGuardian Web Content.
From here you must go to option “Module Configuration” and set up as necessary. Especially is important that logs are put as “Force DG Native”, otherwise this log analyzer will not work.
In dansguardian.conf file this should be set up :
reportinglevel = 2
loglevel = 1
logfileformat = 1
After this rotate logs, and restart DG.

This Webmina DG module looks the same as the dglog2, so there is not much of a difference …..
dglog2 is even a bit simpler.

This entry was posted in Linux and tagged , , . Bookmark the permalink.

Comments are closed.