Changes

From SME Server
Jump to navigationJump to search
m
→‎Blacklists: Added some trouble shooting helps and download script that creates wget log and emails on errors.
Line 46: Line 46:  
Previously blacklists were available from mesd.k12.or.us but this site appears non functional at 28 March 2012
 
Previously blacklists were available from mesd.k12.or.us but this site appears non functional at 28 March 2012
 
Previously there was a blacklist available from dungog.net which was originally installed with packakges from dungog.net in an earlier Howto, but this appears no longer accessible.
 
Previously there was a blacklist available from dungog.net which was originally installed with packakges from dungog.net in an earlier Howto, but this appears no longer accessible.
 +
===Troubleshooting Blacklists===
 +
 +
'''Why are sites not being blacklisted?'''
 +
 +
Keep in mind when using blacklists the interrelations between all blacklists, banned lists, exception lists, gray lists etc.
 +
If sites are not being blacklisted even though the site is in a blacklist file, make sure you have added the path of the blacklist file or uncommented (removed the #) from the path of the blacklisted file from  /etc/dansguardian/lists/bannedsitelist or bannedurllist. You must tell DansGuardian which blacklists to use!
 +
 +
'''Allow some blacklisted sites / Add my own blacklisted sites'''
 +
 +
If you have a site you want to allow or others you do not want to allow, read up for example on the exceptions lists. They override the banned lists. If you regularly update the blacklists with the method above, then any personal changes made in the blacklist folder /etc/dansguardian/lists/blacklists/* will be lost on the next update.  Instead make changes to the various exception, banned, and gray list files in /etc/dansguardian/lists. Changes there will say put.
 +
 +
'''Send yourself Email Warning Message'''
 +
 +
The above script is straight forward and clean and works well. It is suggested to try it first if you are setting up a cron job to regularly download new blacklists.
 +
The below script could be a replacement for those who wish a little more functionality. It adds a log file to the wget command. This might be helpful if for some reason the new blacklist file is not being downloaded. Examining the log file might be useful in troubleshooting. This script also emails you if there is an error in downloading. Obviously this is nice to automatically inform you of possible problems. 
 +
First test the email portion to make sure it works. With all the spam filters etc out there it may or may not be caught by them. Put the following into a command prompt, (add your email.) This will confirm that the main part of the script works. You should receive an email from your server.
 +
 +
echo "See /var/log/blacklists_dl.log on" `uname -n` |/bin/mail -s'Blacklist DL Error' email@someware.com
 +
 +
If the above email test works it confirms that your email can be send. Now here is the script. Follow the instructions above for setting up the blacklists accept use this script instead.
 +
 +
# blacklists update script for dansguardian
 +
# Creates wget log and emails if error downloading.
 +
cd /etc/dansguardian
 +
rm -f blacklists.tar.gz
 +
#If the following site stops allowing downloads you will need to find another
 +
wget -v  http://cri.univ-tlse1.fr/blacklists/download/blacklists.tar.gz -O blacklists.tar.gz -o \
 +
/var/log/blacklists_dl.log
 +
#If an error occurs during download then an email will be sent via the mail program and then will exit.
 +
[ $? -gt 0 ] && echo "See /var/log/blacklists_dl.log on" \
 +
`uname -n` |/bin/mail -s'Blacklist DL Error' colin@scottmission.com && exit 1
 +
tar -zxf blacklists.tar.gz
 +
chown -R root.root blacklists
 +
chmod -R 640 blacklists
 +
find blacklists -name new\* -exec rm {} \;
 +
rm -f blacklists/README
 +
chmod ug+x blacklists
 +
chmod ug+x blacklists/*
    
====dansguardian.conf & dansguardianf1.conf====
 
====dansguardian.conf & dansguardianf1.conf====
50

edits

Navigation menu