ソスvソスソスソスLソスVソスTソス[ソスoソス[ソスナコソスソスソスeソスソスソスcソスtソスBソスソスソス^ソスソスソスソスソスOソスisquidGuardソスj

ソスナ終ソスXソスVソスソスソスF 2019.06.17

ソスソスソスTソスv

Squidソスニ連ソスgソスソスソスト使ソスpソスソスソスソスtソスBソスソスソス^ソスソスソスソスソスOソス\ソスtソスgソスナゑソスソスソスsquidGuardソス利用ソスソスソスト子ソスソスソスソスソスXソス}ソスzソスナアソス_ソスソスソスgソスTソスCソスgソスソスソスフ不ソスKソスリなサソスCソスgソスヨアソスNソスZソスXソスナゑソスソスネゑソスソス謔、ソスノゑソスソスソスBソスソスソスソスソスナは、ソスAソスNソスZソスXソスソスIPソスAソスhソスソスソスXソスソスソスノゑソスソスAソスuソスソスソスbソスNソスソスソスXソスgソスノ登ソス^ソスソスソス黷スソスTソスCソスgソスヨアソスNソスZソスXソスナゑソスソスネゑソスソス謔、ソスノゑソスソスソスB

ソスソスソスソスソス轤ゥソスソスソスソスDHCPソスン抵ソスナ固抵ソスIPソスAソスhソスソスソスXソスソスソスソスソス闢厄ソストてゑソスソスソスソスソスソスソス



ソスソスsquidGuardソスCソスソスソスXソスgソス[ソスソス

[root@centos ~]# yum -y install squidGuardソス@ソスソスソス@squidGuardソスCソスソスソスXソスgソス[ソスソス

ソスソスsquidGuardソスン抵ソス

ソスiソスPソスjGoogleソス|ソスソスRソス}ソスソスソスhソスCソスソスソスXソスgソス[ソスソスソスソスソスソスqソスフ「ソスiソスQソスjソスuソスソスソスbソスNソスソスソスXソスgソス成ソスvソスナ使ソスp
[root@centos ~]# git clone https://github.com/soimort/translate-shellソス@ソスソスソス@translate-shellソス_ソスEソスソスソスソスソス[ソスh

[root@centos ~]# cd translate-shell/ソス@ソスソスソス@ソス_ソスEソスソスソスソスソス[ソスhソスソスfソスBソスソスソスNソスgソスソスソスヨ移難ソス

[root@centos translate-shell]# make && make installソス@ソスソスソス@translate-shellソスCソスソスソスXソスgソス[ソスソス

[root@centos translate-shell]# cdソス@ソスソスソス@ソスzソス[ソスソスソスfソスBソスソスソスNソスgソスソスソスヨ戻ゑソス

[root@centos ~]# rm -rf translate-shell/ソス@ソスソスソス@translate-shellソスfソスBソスソスソスNソスgソスソスソス除

ソスiソスQソスjソスuソスソスソスbソスNソスソスソスXソスgソス成
Shalla's Blacklistsソスナ提供ゑソスソスソスソスuソスソスソスbソスNソスソスソスXソスgソスソスソスgソスpソスソスソスソスB
[root@centos ~]# rm -f /var/squidGuard/blacklists.tar.gzソス@ソスソスソス@squidGuardソスニ一緒ソスノイソスソスソスXソスgソス[ソスソスソスソスソスソスソスTソスソスソスvソスソスソスuソスソスソスbソスNソスソスソスXソスgソス除ソスソスShalla's BlacklistsソスフブソスソスソスbソスNソスソスソスXソスgソスソスソスgソスpソスソスソスソスフで不ソスvソスネゑソスソスソス

[root@centos ~]# vi /etc/cron.daily/squidGuard-blacklists-udateソス@ソスソスソス@ソスuソスソスソスbソスNソスソスソスXソスgソスソスソスソスソスXソスVソスXソスNソスソスソスvソスgソス成
#!/bin/bash

cd /var/squidGuard/

# ソスuソスソスソスbソスNソスソスソスXソスgソス_ソスEソスソスソスソスソス[ソスh
wget http://www.shallalist.de/Downloads/shallalist.tar.gz > /dev/null 2>&1
[ $? -ne 0 ] && echo "$(basename ${0}) aborted!" | mail -s "$(basename ${0}) aborted!" root && exit

# ソスuソスソスソスbソスNソスソスソスXソスgソスWソスJ
tar zxvf shallalist.tar.gz > /dev/null 2>&1
[ $? -ne 0 ] && echo "$(basename ${0}) aborted!" | mail -s "$(basename ${0}) aborted!" root && exit
rm -f shallalist.tar.gz

# squidGuardソスン抵ソスtソス@ソスCソスソスソスiソスuソスソスソスbソスNソスソスソスXソスgソスソス`ソスjソス成
rm -f /etc/squid/squidGuard-blacklist.conf
cat BL/global_usage | while read line
do
    echo ${line} | grep "^NAME:" > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        NAME=`echo ${line} | awk '{print $2}'` 
    fi
    echo ${line} | grep "^DESC EN:" > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        DESC=`echo ${line} | sed -e 's/DESC EN: \(.*\)/\1/p' -e d | /usr/local/bin/trans -b --no-auto :ja` 
    fi
    echo ${line} | grep "^NAME EN:" > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        NAME_FULL=`echo ${line} | sed -e 's/NAME EN: \(.*\)/\1/p' -e d` 
        echo "# ${NAME_FULL}" >> /etc/squid/squidGuard-blacklist.conf
        echo "# ${DESC}" >> /etc/squid/squidGuard-blacklist.conf
        echo "dest ${NAME} {" >> /etc/squid/squidGuard-blacklist.conf
        echo "        domainlist BL/${NAME}/domains" >> /etc/squid/squidGuard-blacklist.conf
        echo "        urllist    BL/${NAME}/urls" >> /etc/squid/squidGuard-blacklist.conf
        echo "        redirect http://centossrv.com/cgi-bin/squidGuard-simple.cgi?clientaddr=%a&clientname=%n&clientuser=%i&clientgroup=%s&targetgroup=%t&url=%u" >> /etc/squid/squidGuard-blacklist.conf
        echo "        log anonymous block.log" >> /etc/squid/squidGuard-blacklist.conf
        echo "}" >> /etc/squid/squidGuard-blacklist.conf
        echo >> /etc/squid/squidGuard-blacklist.conf
    fi
done

if [ ${#} -eq 0 ]; then

    # squidGuardソスン抵ソスtソス@ソスCソスソスソスソスソスソス
    cat /etc/squid/squidGuard-common.conf \
        /etc/squid/squidGuard-src.conf \
        /etc/squid/squidGuard-blacklist.conf \
        /etc/squid/squidGuard-acl.conf > /etc/squid/squidGuard.conf

    # ソスuソスソスソスbソスNソスソスソスXソスgDBソスソス
    squidGuard -C all
    chown -R squid.squid /var/squidGuard/
    chown -R squid.squid /var/log/squidGuard/

    # Squidソスト読み搾ソスソスソス
    squid -k reconfigure
fi

[root@centos ~]# chmod +x /etc/cron.daily/squidGuard-blacklists-udateソス@ソスソスソス@ソスuソスソスソスbソスNソスソスソスXソスgソスソスソスソスソスXソスVソスXソスNソスソスソスvソスgソスノ趣ソスソスsソスソスソスソスソスtソスソス

[root@centos ~]# /etc/cron.daily/squidGuard-blacklists-udate 1ソス@ソスソスソス@ソスuソスソスソスbソスNソスソスソスXソスgソスソスソスソスソスXソスVソスXソスNソスソスソスvソスgソスソスソスsソスisquidGuardソスン抵ソスtソス@ソスCソスソスソスiソスuソスソスソスbソスNソスソスソスXソスgソスソス`ソスjソス成ソスj

ソスiソスRソスjsquidGuardソスン抵ソス
[root@centos ~]# vi /etc/squid/squidGuard-common.confソス@ソスソスソス@squidGuardソスン抵ソスtソス@ソスCソスソスソスiソスソス{ソスjソス成
dbhome /var/squidGuard
logdir /var/log/squidGuard

[root@centos ~]# vi /etc/squid/squidGuard-src.confソス@ソスソスソス@squidGuardソスン抵ソスtソス@ソスCソスソスソスiIPソスAソスhソスソスソスXソスソス`ソスjソス成
# IPソスAソスhソスソスソスXソスソス`ソスiソスヌ暦ソスソスメ)
src admin {
        ip              192.168.1.11
}

# IPソスAソスhソスソスソスXソスソス`ソスiソス}ソス}ソスj
src mama {
        ip              192.168.1.12
}

# IPソスAソスhソスソスソスXソスソス`ソスiソスqソスソスソスj
src kids {
        ip              192.168.1.13
        ip              192.168.1.14
}

[root@centos ~]# vi /etc/squid/squidGuard-acl.confソス@ソスソスソス@squidGuardソスン抵ソスtソス@ソスCソスソスソスiソスAソスNソスZソスXソスソスソスソスソス`ソスjソス成
# ソスAソスNソスZソスXソスソスソスソスソス`
acl {
        
        # ソスAソスNソスZソスXソスソスソスソスソス`ソスiソスヌ暦ソスソスメ)
        admin {
                # ソスソスソスソスソスソス
                pass     any
        }

        # ソスAソスNソスZソスXソスソスソスソスソス`ソスiソス}ソス}ソスj
        mama {
                # ソスソスソスソスソスソス
                pass     any
        }

        # ソスAソスNソスZソスXソスソスソスソスソス`ソスiソスソスソスフ托ソスソスj
        default {
                # ソスuソスソスソスbソスNソスソスソスXソスgソスフ会ソスソスLソスJソスeソスSソスソスソスネ外ソスAソスNソスZソスXソスソスソスソス
                # ソスソスソスeソスJソスeソスSソスソスソスフ意厄ソスソスソスsquidGuardソスン抵ソスtソス@ソスCソスソスソスiソスuソスソスソスbソスNソスソスソスXソスgソスソス`ソスjソスQソスソス
                pass !aggressive !costtraps !dating !drugs !gamble !hacking !porn !religion !sex/lingerie !sex/education !spyware !violence !warez !weapons all
        }
}

[root@centos ~]# cat /etc/squid/squidGuard-common.conf \
/etc/squid/squidGuard-src.conf \
/etc/squid/squidGuard-blacklist.conf \
/etc/squid/squidGuard-acl.conf > /etc/squid/squidGuard.confソス@ソスソスソス@squidGuardソスン抵ソスtソス@ソスCソスソスソスソスソスソス

[root@centos ~]# squidGuard -d -C allソス@ソスソスソス@ソスuソスソスソスbソスNソスソスソスXソスgDBソスソス
ソスE
ソスE
ソスE
2017-06-19 16:01:40 [782] squidGuard 1.4 started (1497855664.965)
2017-06-19 16:01:40 [782] db update done
2017-06-19 16:01:40 [782] squidGuard stopped (1497855700.105)

[root@centos ~]# chown -R squid.squid /var/squidGuard/ソス@ソスソスソス@DBソスfソスBソスソスソスNソスgソスソスソスソスソスLソスメ変更

[root@centos ~]# chown -R squid.squid /var/log/squidGuard/ソス@ソスソスソス@ソスソスソスOソスfソスBソスソスソスNソスgソスソスソスソスソスLソスメ変更

[root@centos ~]# vi /etc/squid/squid.confソス@ソスソスソス@Squidソスン抵ソスtソス@ソスCソスソスソスメ集
ソスネ会ソスソスソスヌ会ソス
# squidGuardソスAソスgソスン抵ソス
url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf

[root@centos ~]# vi /var/www/cgi-bin/squidGuard-simple.cgiソス@ソスソスソス@squidGuard-simple.cgiソスメ集
# Email Adresse des Proxy Administrators:
# Edit to your requirements. Make sure to keep the @ escaped.
my $PROXYEMAIL = "root\@centossrv.com";ソス@ソスソスソス@ソスヌ暦ソスソスメソスソス[ソスソスソスAソスhソスソスソスXソスマ更

    print "      <A HREF=\"http://www.squidguard.org/\"><IMG SRC=\"http://www.squidguard.org/Logos/squidGuard.gif\"\n";ソス@ソスソスソス@squidGuardソスソスソスSURLソスマ更

    print "      <A HREF=\"http://www.squidguard.org/\"><IMG SRC=\"http://www.squidguard.org/Logos/squidGuard.gif\"\n";ソス@ソスソスソス@squidGuardソスソスソスSURLソスマ更

    print "      <A HREF=\"http://www.squidguard.org/\"><IMG SRC=\"http://www.squidguard.org/Logos/squidGuard.gif\"\n";ソス@ソスソスソス@squidGuardソスソスソスSURLソスマ更

[root@centos ~]# systemctl reload squidソス@ソスソスソス@Squidソスン抵ソスト読搾ソスソスソス

ソスiソスSソスjApacheソスン抵ソス
ソスAソスNソスZソスXソスuソスソスソスbソスNソスソスソスノ趣ソスソスsソスソスソスソスソスCGIソスXソスNソスソスソスvソスgソスヨ難ソスソスソスソスソスソスソスフみアソスNソスZソスXソスナゑソスソスソス謔、ソスソスソスソスソスソスソスソスB
[root@centos ~]# vi /etc/httpd/conf.d/squidGuard.confソス@ソスソスソス@ApacheソスpsquidGuardソスン抵ソスtソス@ソスCソスソスソス成
<Files "squidGuard-simple.cgi">
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require ip 127.0.0.1
        Require ip 10.0.0.0/8
        Require ip 172.16.0.0/12
        Require ip 192.168.0.0/16
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order allow,deny
        Allow from 127.0.0.1
        Allow from 10.0.0.0/8
        Allow from 172.16.0.0/12
        Allow from 192.168.0.0/16
    </IfModule>
</Files>

[root@centos ~]# systemctl reload httpdソス@ソスソスソス@ApacheソスpsquidGuardソスン定反ソスf

[root@centos ~]# rm -f /var/www/cgi-bin/squidGuard-simple-de.cgiソス@ソスソスソス@ソスgソスpソスソスソスネゑソスCGIソスXソスNソスソスソスvソスgソス除

[root@centos ~]# rm -f /var/www/cgi-bin/squidGuard.cgiソス@ソスソスソス@ソスgソスpソスソスソスネゑソスCGIソスXソスNソスソスソスvソスgソス除

ソスソスsquidGuardソスmソスF

ソスソスソスヌ暦ソスソスメ、ソス}ソス}ソスヘ厄ソスソスソスソスソスソスノアソスNソスZソスXソスナゑソスソス驍アソスソス
ソスソスソスヌ暦ソスソスメ、ソス}ソス}ソスネ外ソスヘ撰ソスソスソスソスTソスCソスgソスiソスソス:/var/squidGuard/BL/porn/domainsソスノ登ソス^ソスソスソスソストゑソスソスソスTソスCソスgソスjソスノアソスNソスZソスXソスナゑソスソスネゑソスソスソスソスソス


ソスソスソスヨ連ソスRソスソスソスeソスソスソスc

<!ソス\ソスeソスLソスXソスgソスフみゑソス4ソスsソス\ソスソスソスノ追会ソスソスソスCソスソスソスソスソスソス\>



ソスソスソスソスソスフペソス[ソスWソスフトソスbソスvソスヨ戻ゑソス

ソスvソスソスソスCソスoソスVソス[ソス|ソスソスソスVソス[
centossrv.com