URL filter on Linux
posted on 29 Feb 2008 19:45 by tonhor in Linuxผมใช้ 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
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)
- vi /etc/squid/squid.conf
- ตรง http_port 192.168.2.1:8080 transparent <-ใส่เพิ่มเข้าไป
* การ config (squid.conf ) ทำ transparent proxy นี้สำหรับ Squid v. 2.6 ขึ้นไป
>> ความรู้ของบทความจาก คุณสมศักดิ์ บัวเผื่อน
edit @ 1 Mar 2008 01:54:36 by TonHor
[Twitter] ดูสถิติด้วย TweetStats





#1 By K r a i on 2008-04-16 11:48