PDA

View Full Version : URL filter on Linux



tonhor
20-06-2008, 06:22 PM
ผมใช้ Squid v. 2.6.STABLE18 link: http://www.squid-cache.org

check version ของ squid โดย


root@ipcop:~ # /usr/sbin/squid -v
Squid Cache: Version 2.6.STABLE18
[hide=10]
1.แก้ไข squid.conf ในส่วนของ acl และ http_access


* acl blockweb url_regex '/etc/squid/url.txt

นำไปไว้ใต้ข้อความ acl all src 0.0.0.0/0.0.0.0


* http_access deny blockweb

2.สร้าง url.txt ไปไว้ที่ path ที่เรากำหนด เช่น


ipcop.org
sanook.com
\.(.*thai*.*|.*online*.*)$

>> จากนั้น [root@localhost ~]# /etc/init.d/squid restart

Note1 ! `blockweb` เป็นการตั้งชื่อของacl จะตั้งเป้นอะไรก็ได้

Note2 ! ถ้าไม่อยากให้เครื่อง client ต้องไป set ip ของ proxy

(กรณีที่ client มี gatewate เป็น Squid proxy server)

[code]