ดู log file ของ squid ที่ห้อง ~/logs ในแฟ้ม cache.log (ต้องใช้ user squid ในการ set squid ตลอดนะครับ) โดยใช้คำสั่ง tail -f access.log และสามารถอ่านรายละเอียด การกำหนดเพิ่มเติม ได้ที่ http://www.squid-cache.org/Doc/Hierarchy-Tutorial/
ขั้นตอนการติดตั้ง squid ให้เครื่องเป็น proxy server http://www.thailinux.com/1999/04/18/topic2.html
su
adduser squid
passwd squid
su squid (ไม่ใช้ user squid ก็ได้ แต่ถ้าใช้ดูด้วยว่า gcc เปิดหรือไม่)
cd /home/httpd/html/thaiall
tar xfvz squid-2.3-200103110000-src.tar.gz
cd squid-2.3-200103110000
./configure --prefix=/home/squid
make all
make install (แปลกมากที่ บรรทัดนี้ error แต่ก็ไม่เป็นไร เพราะใช้งานได้ปกติ)
cd /home/squid/etc
pico squid.conf
# Detail in file /home/squid/etc/squid.conf หรือ /etc/squid/squid.conf
http_port 3128
cache_peer www.isinthai.com parent 3128 3130
cache_mem 8 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
minimum_object_size 0 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
cache_dir ufs /home/squid/cache 100 16 256
cache_access_log /home/squid/logs/access.log
cache_log /home/squid/logs/cache.log
cache_store_log /home/squid/logs/store.log
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80 21 443 563 70 210 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow all
icp_access allow all
miss_access allow all
cache_effective_user squid
cache_effective_group squid
ทดสอบการทำงานของ squid
cd /home/squid/bin หรือ /usr/sbin
squid -z สร้าง swap directory
squid สั่ง start manual
ps aux|grep squid ดูว่า squid ทำงานใน process หรือไม่
cd /home/squid/logs ห้องนี้เก็บ ผลการทำงานเมื่อใช้ squid
tail -f access.log เมื่อมีคนเปิดเว็บแล้วใช้บริการ squid จะมีผลต่อแฟ้มนี้
วิธีทำให้ทุกครั้งที่เปิดเครื่องแล้ว run squid อัตโนมัติ หรือปรับปรุง
# เพิ่มบรรทัดข้างล่างนี้ไปในแฟ้ม /etc/rc.d/rc.local
su -c "nohup /home/squid/bin/squid&" squid
หรือ
su -c "nohup /usr/sbin/squid&" squid
# เมื่อปรับค่า เช่นขนาดของ cache ใน /home/squid/etc/squid.conf หรือ /etc/squid/squid.conf
แล้วต้องทำบรรทัดข้างล่างนี้ เพื่อ update ค่าต่าง ๆ ใหม่
squid -k reconfigure
# แสดง option ของ squid ให้พิมพ์ว่า
squid -k