วันจันทร์ที่ 22 มกราคม พ.ศ. 2550

ติดตั้ง SquidGuard บน Etch

ติดตั้งโปรแกรม
# aptitude install squidguard

เพิ่มส่วนนี้ในไฟล์ /etc/squid/squid.conf

# TAG: redirect_program
# Specify the location of the executable for the URL redirector.
# Since they can perform almost any function there isn't one included.
# See the Release-Notes for information on how to write one.
# By default, a redirector is not used.
#
redirect_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf

แก้ไขไฟล์ /etc/squid/squidGuard.conf
#################################################
dbhome /var/lib/squidguard/db
logdir /var/log/squid

time workhours {
weekly mtwhfa 08:30 - 18:00
date *-*-* 08:30 - 18:00
}

dest porn {
domainlist BL/porn/domains
urllist BL/porn/urls
}

acl {

default {

pass !porn all
redirect http://www.siamrajathanee.co.th/blacklists/index.html
}
}
#################################################

ดาวน์โหลดไฟล์
wget http://squidguard.shalla.de/Downloads/shallalist.tar.gz

แตกไฟล์ไปไว้ที่ /var/lib/squidguard/db/
tar -xvzf shallalist.tar.gz --directory=/var/lib/squidguard/db/

สร้าง database จาก blacklist ที่กำหนดไว้ในไฟล์ /etc/squid/squidGuard.conf (ทุกครั้งที่คุณแก้ไฟล์ domains, urls ต้องทำการเพิ่มเข้าไปในฐานข้อมูทุกครั้งด้วย)
/usr/bin/squidGuard -C all

ผลจากคำสั่งจะได้ database ไฟล์ (.db) ดังนี้
# ls -lh /var/lib/squidguard/db/BL/porn/
total 57M
-rw-r--r-- 1 1001 1001 11M 2007-01-22 03:40 domains
-rw-r--r-- 1 root root 28M 2007-01-22 11:23 domains.db
-rw-r--r-- 1 1001 1001 5.0M 2007-01-21 00:04 urls
-rw-r--r-- 1 root root 13M 2007-01-22 11:23 urls.db

เปลี่ยนสิทธิ์เพื่อให้โปรแกรม Squid อ่านไฟล์ได้
chown -R proxy.proxy /var/lib/squidguard/db

เริ่มการทำงาน Squid ใหม่
/etc/init.d/squid restart

ที่มา - squidguard.org

1 ความคิดเห็น:

ไม่ระบุชื่อ กล่าวว่า...

ลองทำตามแล้วครับติดตรงคำสั่ง
/usr/bin/squidGuard -C all
ค้างเลยครับ ไม่ทำไรต่อเลย