วันพฤหัสบดีที่ 23 กันยายน พ.ศ. 2553
เขียน firewall ให้ตรวจสอบว่า squid ทำงาน ก็ให้ 80 วิ่งไป squid ถ้าไม่ทำงานก็ วิ่งออก 80 เลย
iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128
else
iptables -t nat -I PREROUTING -p tcp --dport 80 -j ACCEPT
- ความหมายของ Code ก็คือ ถ้า squid ทำงานอยู่ให้ทุก Packet ที่จะออกไป Port 80 ให้ไปที่ Port 3128 ซึ่งเป็น Port ของ squid ก่อน แต่ถ้า squid ไม่ได้ทำงานอยู่ให้ทุก Packet ที่จะออกไป Port 80 ผ่านไปได้เลย
- Firewall จะมีการตรวจสอบ Code ทั้งหมดใหม่เมื่อพิมพ์คำสั่ง service firewall restart ,. /etc/rc.d/rc.firewall.local หรือเมื่อมีการตัด-ต่อของเน็ต เพื่อเช๊ค service ต่างๆ เช่น squid ,frox และทำการจัดสรรเส้นทางให้กับ Packet ตาม Firewall ที่เขียนไว้
- ถึงเรา stop squid ไปแล้ว Firewall ก็ยังทำงานเหมือนเดิมคือถ้าจะออกไป Port 80 ก็ต้องไปที่ squid แต่ squid มันถูกหยุดทำงานไปแล้วมันก็เลยออกไปไหนไม่ได้
- ดังนั้นเราจะทำยังไงให้ Firewall มันรู้ว่า Squid หยุดทำงานไปแล้ว เพื่อที่มันจะได้จัดสรรเส้นทางใหม่ให้กับ Packet ว่า ถ้าจะออกไป Port 80 ไม่ต้องผ่าน Squid แล้วให้ออกไปได้เลย ก็คือ Restart Firewall ครับ
เขียน firewall ให้ตรวจสอบว่า squid ทำงาน ก็ให้ 80 วิ่งไป squid ถ้าไม่ทำงานก็ วิ่งออก 80 เลย
iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128
else
iptables -t nat -I PREROUTING -p tcp --dport 80 -j ACCEPT
- ความหมายของ Code ก็คือ ถ้า squid ทำงานอยู่ให้ทุก Packet ที่จะออกไป Port 80 ให้ไปที่ Port 3128 ซึ่งเป็น Port ของ squid ก่อน แต่ถ้า squid ไม่ได้ทำงานอยู่ให้ทุก Packet ที่จะออกไป Port 80 ผ่านไปได้เลย
- Firewall จะมีการตรวจสอบ Code ทั้งหมดใหม่เมื่อพิมพ์คำสั่ง service firewall restart ,. /etc/rc.d/rc.firewall.local หรือเมื่อมีการตัด-ต่อของเน็ต เพื่อเช๊ค service ต่างๆ เช่น squid ,frox และทำการจัดสรรเส้นทางให้กับ Packet ตาม Firewall ที่เขียนไว้
- ถึงเรา stop squid ไปแล้ว Firewall ก็ยังทำงานเหมือนเดิมคือถ้าจะออกไป Port 80 ก็ต้องไปที่ squid แต่ squid มันถูกหยุดทำงานไปแล้วมันก็เลยออกไปไหนไม่ได้
- ดังนั้นเราจะทำยังไงให้ Firewall มันรู้ว่า Squid หยุดทำงานไปแล้ว เพื่อที่มันจะได้จัดสรรเส้นทางใหม่ให้กับ Packet ว่า ถ้าจะออกไป Port 80 ไม่ต้องผ่าน Squid แล้วให้ออกไปได้เลย ก็คือ Restart Firewall ครับ
ลง squid 2.6 r13 แทน squid 2.5
apt-get clean
apt-get update
rpm -Uhv squid >>>>ทีื่จะติดตั้ง
service squid restart
ทำตามนี้นะครับ
cd /var/spool
chown -R squid:squid squid
chmod 777 squid
cd /var/log
chown -R squid:squid squid
cd squid
touch access.log
touch store.log
touch cache.log
chmod 777 access.log
chmod 777 store.log
chmod 777 cache.log
เสร็จแล้วก็ squid -z
service squid restart
วันพุธที่ 8 กันยายน พ.ศ. 2553
จำักัด bandwidth ด้วย squid
ชื่อเรื่อง: Squid (Delay pools)
ที่มา : www squid-cache.org, www.thaifast.com, www.thaicert.nedtec.or.th, www.squid.visolve.com, www.tng.prirate.dk/how -squid.html
เรียบเรียงโดย :
1. นางสาวรัตนา โพธิบัติ
2. นางสาวลลิตา ธงชัย
3. นางสาววาสนา ช่างถม
4. นางสาวสกาวรัตน์ เขาแก้ว
5. นางสาวอุมา ชัยสุวรรณ์
เผยแพร่เมื่อ: 26 กุมภาพันธ์ 2547
Proxy
ทำหน้าที่เป็นที่พักข้อมูลที่ถูกดึงมาจาก Server ภายนอก ไม่ว่าจะเป็นภาพ , เสียง , เอกสาร , html เป็นต้น
การใช้ Proxy server โดยทั่วไปผู้บริหารระบบจะทำการกำหนดให้เครื่อง client ในเครึอข่ายค้นหาไฟล์หรือข้อมูลจาก proxy server ก่อนที่จะไปค้นหา server ภายนอก เพื่อเป็นการประหยัด ช่องทางการจารจร เพื่อให้การเล่นอินเทอร์เน็ตจัดการได้เร็วขึ้นโดยการทำงานของ proxy server จะถูกจัดการโดยโปรแกรม squid
Squid
คือโปรแกรมที่ทำหน้าที่เป็น Proxyและ Cache เซิร์ฟเวอร์ที่มีประสิทธิภาพสูง เราสามารถค่า configuration ต่าง ๆ ของ squid เพื่อทำเป็น Proxy server เช่น การกำหนดขนาดของพื้นที่ที่ใช้ในการเก็บข้อมูล ทั้งในดีสก์และในแรม นอกจากนี้แล้ว เรายังสามารถทำการบริหารช่องทางที่เรียกว่า Bandwidth โดยใช้ squid ได้อีกด้วยโดยใช้ delay pools
Delay pools
Delay pools ทำหน้าที่ใช้เพื่อควบคุมปริมาณการใช้Traffic หรือการวิ่งของข้อมูลเพื่อไม่ให้ Bandwidth เต็มหรือพูดอีกอย่างหนึ่งได้ว่าเป็นการทำ Traffic Shaper
การกำหนดค่า Squid
ใช้คำสั่ง#pico squid.conf
http_port 8080 #เป็นตัวกำหนด squid เพื่อฟังการร้องขอมากจาก client โดยกำหนดมาที่ port 8080
# หลีกเลี่ยงการเก็บ cgi scripts ลงในแคช
acl QUERY urlpath_regex cgi-bin
no_cache deny QUERY
#ส่วนนี้ใช้ทำ transparent proxy
httpd_accel_host virtual httpd_accel_port 0
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
# ขนาดแรมที่มีอยู่จริงในเครื่องหาร 3
cache_mem 350 MB #กำหนดขนาดหรือการจองพื้นที่ใน Ram มาทำเป็น cache memory เพราะว่า CPU สามารถดึงข้อมูลใน Ram ได้เร็วกว่าใน Disk
# ที่เก็บ log files ถ้าไม่เก็บล็อกไฟล์ก็ /dev/null แทนไดเร็กทอรีนั้น ๆ
cache_dir diskd /cache 1000 16 256 Q1=72 Q2=64 #หมายเลข 1000 นี้เป็นขนาดดิสก์ที่ squid ที่จองไว้ใช้ทำดิสก์แคชมีขนาด 1000 เมกะไบต์
cache_access_log /var/log/squid/access.log #มีไว้เก็บข้อมูลการร้องขอ client สำหรับทุก ๆ http และ icpquery
cache_store_log /var/log/squid/store.log #แสดงถึง log-file ที่เก็บไว้ใน cache
cache_log /var/log/squid/cache.log #เก็บขนาดของ object ที่ถูกดาวโหลดเข้าใน server
# กำหนดวิธีการแทนที่ข้อมูลเดิมในแคช
cache_replacement_policy GDSF #เป็นวิธีการแทนที่ไฟล์ที่เก็บไว้ใน cache
dns_testnames 202.29.14.1
logfile_rotate 10 #กำหนดให้ logfile ทำงานแบบครบ 10 ไฟล์ค่อยแทนของเดิม
#acl = Access List เป็นการตั้งส่วนควบคุมการใช้งาน Proxy/cache เซิร์ฟเวอร์
acl all src 0.0.0.0/0.0.0.0 #all เป็นชื่อ ที่กำหนดให้ต้นทางคือทุกเครื่อง
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255 # localhost เป็นชื่อคือต้นทางคือเครื่องตัวเอง
acl rinet src 202.29.14.0/255.255.255.0 # rinet เป็นชื่อ ที่ใช้กำหนดให้ต้นทางคือ ip ในเน็ตเวิร์คขององค์กร
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#อนุญาตหรือไม่อนุญาต acl ที่ตั้งไว้ http_access allow manager
http_access allow localhost
http_access allow rinet
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
icp_access allow localhost
icp_access allow rinet
#ส่วน acl ก่อนการทำ Delay pools
acl magic_words1 url_regex -i 202.29.14.1
#กำหนด acl กลุ่มที่มีสิทธิ์ทุกอย่าง acl magic_words2 url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .rpm .zip .rar .avi .mpeg .mpe .mpg .qt .ram .rm .iso .raw .wav .mov #กำหนด acl กลุ่มที่ต้องควบคุม traffic คือไฟล์บางประเภทที่ใหญ่ ๆ
การกำหนดค่า Squid(Delay Pool)
# สำหรับ delay pool ที่คุณต้องการ --enable-delay-pools
delay_pools 2 #กำหนดให้มี 2 pool ที่ต้องใช้
#สมมุติมี link ขนาด 2Mbits ซึ่ง 2 mbits == 256 kbytes ต่อวินาที เราจะจำกัดให้ใช้ได้ไม่เกิน 5 KB/s ต่อโหนด
delay_class 1 2 #กำหนดให้ pool ที่ 1 เป็น class 2 ที่ถูกกำหนดค่าไว้ใน magic_word2 แบบจำกัด
delay_parameters 1 256000/256000 5000/256000
delay_access 1 allow magic_words2 #กลุ่มที่ดาวน์โหนดไฟล์ต่าง ๆ ที่กำนดไว้
delay_access 1 allow rinet #กลุ่มที่มี ip ต้นทางเป็นเครือข่ายภายใน
# -1/-1 หมายความว่าไม่มีการจำกัดขนาดของ traffic.
delay_class 2 2 #กำหนดให้ pool ที่ 2 เป็น class 2 ที่ถูกกำหนดค่าไว้ใน magic_word1 แบบไม่จำกัด
delay_parameters 2 -1/-1 -1/-1
delay_access 2 allow magic_words1
# ไม่จำกัดขนาด
reply_body_max_size 0 allow all
#ส่วน snmp เพื่อเอาไว้ใช้วัดการใช้งาน traffic
acl snmppublic snmp_community public
snmp_access allow snmppublic localhost
snmp_access deny all
# Change domain
cache_mgr noc@ribr.ac.th
cachemgr_passwd secret_password all
visible_hostname proxy1.ribr.ac.th
unique_hostname proxy1.ribr.ac.th
#******************************* End of squid.conf file *********************************
สร้าง Cache Directory
ใช้คำสั่ง#mkdir /cache
#cdmod 755 /cache/
#chown -R squid:squid /cache/
#mkdir /var/log/squid/
#chmod 755 /var/log/squid/
#chown -R squid:squid /cache/
#squid -z
#service squid start
ถ้าถูกต้องจะขึ้น[OK] ที่บรรทัด startting squid
ใช้คำสั่ง#tail -f/var/log/squid/access.log เพื่อติดตามการทำงานของ squid ูว่ามีการร้องขอใช้ proxy หรือยัง
ลองหาดาวน์โหลดไฟล์พวก .zip ดูว่าความเร็วในการดาวน์โหลดไม่เกิน 5 Kb จริงหรือไม่ ...
พื้นฐาน iptables
แก้ปัญหา iptables หลังเปลี่ยน version cc
http://www.thaicert.nectec.or.th/paper/firewall/iptables.php
เรื่อง ACL ของ squid
เพิ่มเติ่ม refresh pattern
#43200 = 1 month
#1440 = 1 day
#7200 = 5 day
refresh_pattern
1.ทำความเข้าใจกับคำว่า " refresh_pattern "
2.แก้ไขไฟล์ คอนฟิก squid.conf.tmpl
3.รีสตาร์ทเซอร์วิส ของ Squid
1.ทำความเข้าใจกับคำว่า " refresh_pattern "


refresh pattern ใน squid.conf จะอยู่ในรูปแบบ:
refresh_pattern [-i] regex min percent max [options]
โดยที่




ตัวอย่างเช่น
refresh_pattern -i \.gif$ 1440 20% 10080
หมายความว่า: ถ้าอ็อบเจกต์ *.gif มี header ระบุเวลาหมดอายุ ก็เชื่อถือตาม header นั้น จบ ถ้าไม่มี จึงพิจารณาต่อไป ถ้าอ็อบเจกต์อยู่ในแคชต่ำกว่า 1440 นาที (1 วัน) ถือว่ายังใหม่อยู่ ใช้ค่าในแคชตอบกลับได้ทันที
ถ้าอ็อบเจกต์อยู่ในแคชมานานเกิน 10080 นาที (7 วัน) ถือว่าเก่าแล้ว ให้ดึงอ็อบเจกต์มาใหม่จากเว็บเซิร์ฟเวอร์
ถ้า อายุในแคชของอ็อบเจกต์อยู่ระหว่าง 1440-10080 นาที ให้พิจารณาอายุในแคช ว่าถึง 20% ของอายุจริงหรือไม่ เช่น ถ้าเว็บเซิร์ฟเวอร์รายงานมาว่าอ็อบเจกต์นี้สร้างขึ้นเมื่อ 10,000 นาทีที่แล้ว ก็พิจารณาว่าอ็อบเจกต์อยู่ในแคชมานานถึง 20% ของ 10,000 คือ 2,000 นาทีหรือไม่ ถ้ายังไม่ถึง ก็ถือว่ายังใหม่ ถ้าถึง ก็ถือว่าเก่าแล้วส่วน options หรือตัวเลือกเพิ่มเติม ส่วนใหญ่จะเป็นการพยายามละเมิดมาตรฐาน HTML เพื่อเพิ่มอัตราการแคช จึงควรระมัดระวังในการใช้งาน ตัวเลือกมีดังนี้:
override-expire -- ไม่ต้องสนใจ header ระบุเวลาหมดอายุที่เว็บเซิร์ฟเวอร์บอกมา (พิจารณาตามกฎเสมอ)
override-lastmod -- ไม่สนใจ header ระบุเวลาเปลี่ยนแปลงล่าสุดที่เว็บเซิร์ฟเวอร์บอกมา (ถือว่าอ็อบเจกต์มีอายุจริงเท่ากับ min แม้จะเพิ่งเปลี่ยนแปลงใหม่)
reload-into-ims -- เปลี่ยน request "no-cache" จากลูกข่ายให้เป็น If-Modified-Since
ignore-reload -- ไม่สนใจ header "no-cache" จากลูกข่าย และจะใช้ข้อมูลในแคชถ้าทำได้
ignore-no-cache -- ไม่สนใจ header "Pragma: no-cache" และ "Cache-control: no-cache" ที่ส่งมาจากเว็บเซิร์ฟเวอร์ ซึ่ง HTTP RFC ไม่ได้อนุญาตให้เว็บเซิร์ฟเวอร์ทำ แต่ก็มักจะทำกัน
ignore-no-store -- ไม่สนใจ header "Cache-control: no-store" ที่ส่งมาจากเว็บเซิร์ฟเวอร์
ignore-private -- ไม่สนใจ header "Cache-control: private" ที่ส่งมาจากเว็บเซิร์ฟเวอร์
ignore-auth -- เก็บอ็อบเจกต์ที่ต้องผ่านการยืนยันตัวบุคคลของผู้อ่านลงแคชด้วย
refresh-ims -- ส่ง request If-Modified-Since ไปที่เว็บเซิร์ฟเวอร์เมื่อผู้ใช้ refresh หน้าเว็บ
คุณ สามารถปรับ refresh pattern ให้เก็บอ็อบเจกต์ที่มักไม่มีการเปลี่ยนแปลง เช่น รูปภาพ เสียง วีดิทัศน์ แฟ้มโปรแกรม แฟ้มบีบอัด ฯลฯ ให้อยู่ในแคชนานขึ้นได้ เพื่อเพิ่มอัตราการ hit เช่น (คัดลอกมาจากบทความต้นตอ):
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i \.(gif|png|jpg|jpeg|ico)$ \
10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.(iso|avi|wav|mp3|mp4|mpeg|swf|flv|x-flv)$ \
43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.(deb|rpm|exe|zip|tar|tgz|ram|rar|bin|ppt|doc|tiff)$ \
10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.index.(html|htm)$ 0 40% 10080
refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 40320
refresh_pattern . 0 40% 40320
กฎ จะถูกนำมาตรวจสอบเรียงทีละกฎจากบนลงล่าง จนกว่าจะพบกฎแรกที่ตรง ก็จะใช้กฎนั้นและหยุดตรวจสอบต่อ ดังนั้น กฎสุดท้ายจึงเป็นกฎที่เอาไว้รองรับแพตเทิร์นที่เหลือโดยทั่วไป และมักจะแยกกฎสำหรับโพรโทคอลอื่นอย่างเช่น FTP และ gopher เอาไว้บนสุด เพื่อกันไม่ให้มาใช้กฎด้านล่าง
2.แก้ไขไฟล์ คอนฟิก squid.conf.tmpl2.1 เปิดโปรแกรม winscp ขึ้นมา แล้วเข้าไปที่ /etc/squid และทำการคลิกขวาที่ไฟล์ชื่อ squid.conf.tmpl แล้วเลือก Edit ดังรูป
2.2 ต่อไปให้นำคำสั่งนี้ ไปเพิ่มที่ส่วนท้ายของไฟล์ squid.conf.tmpl ดังรูป แล้วทำการบันทึก
refresh_pattern -i \.art$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.crw$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.djvu$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ttf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.fpx$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.icn$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ico$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.icl$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.kdc$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mag$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.sif$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.aifc$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.aiff$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.asf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.au$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.avi$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.m1v$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mid$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.midi$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mp2$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mp2v$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mp3$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpa$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpe$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpeg$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpg$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mpv2$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.rmi$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.snd$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.wav$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.wma$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.wmv$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.sid$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pcd$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pic$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pict$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pix$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pbm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pgm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ppm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.eps$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.psp$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.xbm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.xpm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.bmp$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.jpeg$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pcx$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.png$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.tga$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.tiff$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.gif$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.wmf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.emf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pic$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.iff$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.psd$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ras$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.rs$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.sgi$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.swf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pdf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.exe$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.zip$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.rar$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mov$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.cda$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mp1$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.aac$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.nsa$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ogg$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.kar$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.miz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mod$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mdz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.nst$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.stm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.stz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.s3m$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.s3z$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.it$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.itz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.xm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.xmz$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.mtm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ult$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.669$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.far$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.amf$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.okt$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.ptm$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.voc$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.aif$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.m2v$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.nsv$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.m3u$ 525960 80% 525960 reload-into-ims
refresh_pattern -i \.pls$ 525960 80% 525960 reload-into-ims
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
-----------------------------------------------------------------------------------------------


3.รีสตาร์ทเซอร์วิส ของ Squid
วันอาทิตย์ที่ 5 กันยายน พ.ศ. 2553
แก้ปัญหา cacti ไม่สามารถดู network interface
วิธีการแก้ปัญหาก็ง่ายๆ ครับ ไปที่ /etc/snmp แก้ snmpd.conf ของ CentOS ที่ต้องการดู Traffic และเพิ่มบรรทัดสีเขียวนี้เข้าไปครับ
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
view systemview included .1
access notConfigGroup "" any noauth exact systemview none none
แค่นี้ Cacti ก็จะสามารถ รับข้อมูล SNMP
install CACTI on CC
2.install rrd
wget http://dag.wieers.com/rpm/packages/rrdtool/rrdtool-1.0.50-3.el4.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/rrdtool/rrdtool-devel-1.0.50-3.el4.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/rrdtool/perl-rrdtool-1.0.50-3.el4.rf.i386.rpm
rpm -Uvh rrdtool-1.0.50-3.el4.rf.i386.rpm rrdtool-devel-1.0.50-3.el4.rf.i386.rpm perl-rrdtool-1.0.50-3.el4.rf.i386.rpm
3.install cacti
apt-get install net-snmp net-snmp-devel net-snmp-libs net-snmp-utils php-snmp
wget http://dag.wieers.com/rpm/packages/cacti/cacti-0.8.7b-2.el4.rf.noarch.rpm
rpm -Uvh cacti-0.8.7b-2.el4.rf.noarch.rpm
4.Config mysql & www
4.1 vi /var/www/cacti/include/config.php
/* make sure these values refect your actual database/host/user/password */ |
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactiuser";
$database_port = "3306";
?>
4.2 vi /etc/httpd/conf.d/cacti.conf
Alias /cacti/ /var/www/cacti/
DirectoryIndex index.php
Options -Indexes
AllowOverride all
order deny,allow
# deny from all
allow from 127.0.0.1
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc on
php_flag track_vars on
5. Create mysql database
3.1 mysqladmin --user=root create cacti
3.2 quit;
3.3 cd /var/www/cacti/
3.4 mysql -u root cacti < cacti.sql
3.5 mysql -u root
3.6 mysql>grant all on cacti.* to cactiuser@localhost identified by "cactiuser";
3.7 mysql>flush privileges;
3.8 show databases;
3.9 quit;
6.install cacti in www
service httpd restart
6.1 http://ipaddress.server/cacti/instiall
6.2 Next >> New Install Next >> Finish
user : admin
pass : admin
ปัญหา wordpad ใน windows 11 หาย แก้ไขแบบนี้
https://win7games.com/#wordpad download มาติดตั้งซะ
-
When I add column to grid in design time via right-click->Columns editor, I can't remove it from this place. I get error message ...
-
crontab -e แล้วเพิ่มข้อความ 00 00 * * * /sbin/reboot หรือ 00 00 * * * /sbin/shutdown -r now อันนี้ reboot ทุกเที่ยงคืน เปลี่ยนเวลาเอาเองนะค...
-
ทำ network มาเรื่อยๆจนถึงส่วนของ DMZ มันคืออะไรกันแน่ อยากรู้ก็เลยศึกษาอีกเผื่อจะได้ใช้ในอนาคต DMZ ย่อมาจาก Demilitarized Zone หรือเขตปล...