Install and Configure SARG to report against Dansguardian log files on CentOSGo back to the main project page
By this point, you should already have DansGuardian and Squid cache installed, configured, and tested. If not, please visit the Open Source Web Content Filtering Project page to finish that part of the setup.
There is other settings I’m looking into with regards to DansGuardian. This is just a rough way to get SARG up and reporting.
Install Apache
* yum install httpd – install Apache if not already installed
Add ports to firewall
* You may need to add a firewall rule to allow port 80
* vi /etc/sysconfig/iptables – add the following lines, if they don’t already exist
* -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPTInstall SARG
* cd /usr/src – optional, this is just where I like to keep the source archives
* wget http://dag.wieers.com/rpm/packages/sarg/sarg-2.2.1-1.el4.rf.i386.rpm – download the SARG rpm to your /usr/src folder
* yum install gd gd-devel
* rpm -i /usr/src/sarg-2.2.1-1.el4.rf.i386.rpm – install SARG using the Red Hat Package manager
* vi /etc/httpd/conf.d/sarg.conf* add an additional Allow from line for each computer you want to be able to see the reports, or comment out the Deny from all, and Allow from lines to give access to all.
Configure DansGuardian and SARG to work with each other
* vi /etc/dansguardian/dansguardian.conf
* change the setting logfileformat to equal 3 – sets DansGuardian to log in squid log file format
* :wq – save the changes to the file and quit* vi /etc/sarg/sarg.conf
* change the setting access_log to point to your dansguardian logs. Under default settings, it should be /var/log/dansguardian/access.log
* change any other settings you want to change
* :wq – save the changes to the file and quit* Check the sarg scripts in the cron folders. You will need to make some changes to point to the DansGuardian log files
* vi /etc/cron.daily/sarg – really no changes here
* vi /etc/cron.weekly/sarg – change the log file paths to the path of your DansGuardian log files
* vi /etc/cron.monthly/sarg – change the log file paths to the path of your DansGuardian log files* /usr/bin/sarg – run sarg to create a ONE-SHOT report
Start Apache
* /etc/init.d/httpd start – Start Apache
Test Configuration
* browse to your DansGuardian machine using your favorite internet browser. You will have to add /sarg to the end of the url. (ex. http://192.168.0.1/sarg Check to make sure the ONE-SHOT report was generated.
* wait for the cron jobs to run and generate the rest of the reports
Done


