[root@centos5
~]# yum install yumex
yum-fastestmirror yum-priorities |
[root@centos5
~]# mcedit
/etc/yum.repos.d/CentOS-Base.repo |
[root@centos5
~]# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm |
[root@centos5
~]#
mcedit
/etc/yum.repos.d/rpmforge.repo |
[root@centos5
~]# yum --enablerepo=rpmforge
install squidguard |
[root@centos5
~]# mkdir /root/conf.orig [root@centos5 ~]# cp /etc/squid/squidguard.conf /root/conf.orig |
ads | adult | aggressive |
drugs | filehosting | filesharing |
gambling | games | hacking |
malware | porn | proxy |
warez |
[root@centos5 ~]# mkdir
/var/lib/squidguard/hirdetes [root@centos5 ~]# touch /var/lib/squidguard/hirdetes/domains [root@centos5 ~]# touch /var/lib/squidguard/hirdetes/urls [root@centos5 ~]# chown -R squid:squid /var/lib/squidguard |
[root@centos5 ~]# mkdir /var/www/html/images |
Az állomány neve | Könyvtár |
squidguard.conf | /etc/squid |
nulbanner.png | /var/www/html/images |
blocked.gif | /var/www/html/images |
squidGuard.cgi | /var/www/cgi-bin |
rebuild.scp | /root |
[root@centos5
~]#
chmod
755 /var/www/cgi-bin/squidGuard.cgi |
redirect_program /usr/bin/squidguard -c /etc/squid/squidguard.conf |
[root@centos5
~]# service httpd start [root@centos5 ~]# chkconfig --levels 235 httpd on |
[root@centos5 ~]# chmod u+x /root/rebuild.scp [root@centos5 ~]# ./rebuild.scp |
#!/bin/bash /usr/bin/squidguard -C all #/usr/bin/squidguard -C /var/lib/squidguard/porn/domains #/usr/bin/squidguard -C /var/lib/squidguard/porn/urls chown -R squid:squid /var/lib/squidguard squid -k reconfigure |
nojelszo { pass !ads !adult !hirdetes !aggressive !drugs !gambling !games !hacking !malware !porn !proxy !warez all } |
dest ads { domainlist ads/domains urllist ads/urls redirect http://localhost/images/nulbanner.png } |
time
tanulok-time { weekly m 11:15-11:35 12:15-16:59 weekly t 11:15-11:35 12:15-16:59 weekly w 11:15-11:35 11:46-16:59 weekly h 11:15-11:35 11:46-16:59 weekly f 11:15-11:35 11:46-16:59 weekly a 11:15-11:35 11:46-16:59 weekly s 09:01-12:00 } |
weekly m 11:15-11:35 12:15-16:59 21:00-23:59 |
[root@centos5 ~]# squid -k reconfigure |
[root@centos5 ~]# mcedit /var/lib/squidguard/adult/domains |
[root@centos5 ~]# mcedit /var/lib/squidguard/porn/domains |
[root@centos5 ~]# /root/rebuild.scp |
#---------------------------------------------------------------- # SquidGuard CONFIGURATION FILE #---------------------------------------------------------------- # CONFIGURATION DIRECTORIES dbhome /var/lib/squidguard logdir /var/log/squid # TIME RULES: # abbrev for weekdays: # s = sun, m = mon, t =tue, w = wed, h = thu, f = fri, a = sat # s = vasarnap, m = hetfo, t =kedd, w = szerda, h = csutortok, f = pentek, a = szombat time tanulok-time { weekly m 11:15-11:35 12:15-16:59 21:00-23:59 weekly t 11:15-11:35 12:15-16:59 weekly w 11:15-11:35 11:46-16:59 weekly h 11:15-11:35 11:46-16:59 weekly f 11:15-11:35 11:46-16:59 weekly a 11:15-11:35 11:46-16:59 weekly s 09:01-12:00 } time tanar-time { weekly * 00:00-24:00 # tanaroknak mindig } # SOURCE ADDRESSES: # src nojelszo { iplist /etc/squid/nojelszo.txt } # src tanulok { userlist /etc/squid/csoportok/tanulok.txt } # src tanar { userlist /etc/squid/csoportok/tanar.txt } # DESTINATION CLASSES: dest ads { domainlist ads/domains urllist ads/urls redirect http://localhost/images/nulbanner.png } dest adult { domainlist adult/domains urllist adult/urls } dest aggressive { domainlist aggressive/domains urllist aggressive/urls } dest drugs { domainlist drugs/domains urllist drugs/urls } dest filehosting { domainlist filehosting/domains urllist filehosting/urls } dest filesharing { domainlist filesharing/domains urllist filesharing/urls } dest gambling { domainlist gambling/domains urllist gambling/urls } dest games { domainlist games/domains urllist games/urls } dest hacking { domainlist hacking/domains urllist hacking/urls } dest malware { domainlist malware/domains urllist malware/urls } dest porn { domainlist porn/domains urllist porn/urls expressionlist porn/expressions } dest proxy { domainlist proxy/domains urllist proxy/urls } dest warez { domainlist warez/domains urllist warez/urls } dest hirdetes { domainlist hirdetes/domains urllist hirdetes/urls redirect http://localhost/images/nulbanner.png # log /var/log/squid/hirdetes.log } # ACLs acl { # A nojelszo src-nek: nojelszo { pass !ads !adult !hirdetes !aggressive !drugs !gambling !games !malware !porn !proxy !warez all } # A TANULOK szabalyai tanulok within tanulok-time { pass !ads !adult !hirdetes !aggressive !drugs !filehosting !filesharing !gambling !games !hacking !malware !porn !proxy !warez all redirect http://127.0.0.1/cgi-bin/squidGuard.cgi?clientaddr=%a&srcclass=%s&targetclass=%t&url=%u } # TANAROK szabalyai tanar within tanar-time { pass !ads !adult !hirdetes !aggressive !drugs !gambling !games !malware !porn !proxy !warez all redirect http://127.0.0.1/cgi-bin/squidGuard.cgi?clientaddr=%a&srcclass=%s&targetclass=%t&url=%u } # Alapertelmezes default { pass none redirect http://127.0.0.1/cgi-bin/squidGuard.cgi?clientaddr=%a&srcclass=%s&targetclass=%t&url=%u } } |
[root@centos5 ~]# tail -f /var/log/squid/access.log | grep '\.swf' |
# -----
A nopass IP-knek nagyobb sav delay_pools 2 delay_class 1 2 delay_parameters 1 -1/-1 19800/19800 delay_access 1 allow nopass delay_access 1 deny all # ----- Mindenki masnak delay_class 2 2 delay_parameters 2 -1/-1 12000/12000 delay_access 2 deny nopass delay_access 2 allow mynetwork delay_access 2 deny all |
[root@centos5 ~]# squid -k reconfigure |