Archive for the ‘debian’ Category
Posted by อัทศักดิ์ วงศ์กิตตะ on Monday, September 1st, 2008
คือมี case ที่ต้องทำ transparent proxy ครับ แต่ว่าเวลา proxy มีปัญหา ผมอยากให้ทำการ ปลด proxy ออกเอง ผมเลยเขียน shell script มาเพื่อทำการ ตรวจสอบว่า proxy ทำได้หรือเปล่า ถ้าทำงานได้ ก็จะเพิ่ม iptables ทำการสร้าง DNAT ไปยังเครื่อง Proxy ครับ
คลิกที่นี่เพื่อดูส่วนที่เหลือ »
Tags: Linux, Proxy, Shell script, Squid, Transparent, TransparentProxy
Posted in Development, FreeBSD, Shell script, debian | 1 Comment »
Posted by อัทศักดิ์ วงศ์กิตตะ on Sunday, August 24th, 2008
ตามที่ พรบ ได้กำหนดให้ “ผู้ให้บริการ” เก็บ log การใช้บริการ โชคดีที่ผมมี Revert Proxy วางไว้หน้า Web Server ทำให้สามารถเก็บ Log ได้ง่ายหน่อย ตัว script ที่ผมเขียนนี้ จะทำการ rotate log และ compress log ไว้ ใน version ต่อไป จะทำการ ftp ไปไว้ยัง Log Server อื่น แทนครับ 
คลิกที่นี่เพื่อดูส่วนที่เหลือ »
Tags: Apache, Log, Proxy, Revert, Rotate, Squid, พรบ
Posted in Development, Shell script, debian | 3 Comments »
Posted by กวิน ชัยเลิศ on Friday, July 11th, 2008
ในเบื่องต้นผมขอแนะนำให้รู้จัก Squid กันก่อนครับ
Squid เป็น Open Source Software ที่ให้บริการ Proxy caches ซึ่ง Squid สามารถติดตั้งให้ทำงานใน 3 รูปแบบหลักดังนี้
1. Standard Proxy Cache
ใช้สำหรับเก็บ cache ของ static web pages จำพวก html และรูปภาพ โดยทั่วไปมักจะถูกใช้งานใน network ภายในองค์กร โดยที่ web pages ต่างๆ ที่ถูกเรียกผ่าน local network เป็นครั้งที่สอง web browser จะแสดงผล web pages นั้นผ่าน proxy cache แทนที่ไปดึงข้อมูลจาก web server มาแสดงผล (ประหยัด bandwidth และเพิ่มความเร็วในการแสดงผล)
2. Transparent Cache
ความสามารถหลักๆ เหมือนกับการติดตั้งแบบ standard proxy cache จะแตกต่างกันที่การติดตั้งแบบ transparent cache ไม่จำเป็นต้องปรับแต่ง web browser ให้สามารถใช้งาน proxy cache โดยที่ transparent cache จะทำหน้าที่คอยกรอง HTTP traffic (on port 80) แล้วตรวจสอบว่า request นั้นมีอยู่ใน cahce หรือไม่ ถ้าไม่มีก็จะทำการส่งต่อไปยัง web server ของ web pages นั้น (สำหรับ Linux การใช้งาน transparent cache จะใช้ควบคู่ไปกับ iptables ในการกรอง HTTP traffic)
3. Reverse Proxy Cache
สำหรับ reverse proxy cache จะทำหน้าที่แตกต่างกับ standard และ transparent caches โดยที่ reverse proxy cache จะทำหน้าที่ลดภาระของ web server แทนที่การลด network bandwidth ของฝั่ง client กล่าวคือ reverse proxy cache ถูกติดตั้งอยู่หน้า web server (ระหว่าง internet และ web server) คอยจัดการ traffic ที่เกิดขึ้นทั้งหมดก่อนจะถึง web server ป้องกัน traffic ที่เพิ่มขึ้นโดยไม่พีงประสงค์ (ซึ่งอาจจะโดนโจมตีจาก hacker เป็นต้น) อีกทั้งยังลดภาระของ web server อีกทางนึง

คลิกที่นี่เพื่อดูส่วนที่เหลือ »
Tags: centos, HTTP traffic, httpd-accelerator, Implement, Proxy, Reverse Proxy, Squid, transparent cache
Posted in CentOS, FreeBSD, debian, ubuntu | 2 Comments »
Posted by กวิน ชัยเลิศ on Thursday, July 3rd, 2008
ไม่ยากใช่ไหมครับหากต้องการยกเลิก screen saver บน X window แต่สำหรับ text mode (linux console) ผมคิดว่าหลายๆ คนยังไม่เคยยกเลิก blank screen หรือกำลังหาทางยกเลิกมันอยู่ สำหรับผมแล้วการยกเลิก blank screen บน linux console นั้นมีประโยชน์มากครับ ยกตัวอย่างเช่น เราสามารถทำงานไปพร้อมๆ กันกับการ monitor ดู error หรือ log จากอีกจอนึง (กรณีมีจอ monitor มากกว่าหนึ่งจอ) โดยที่ไม่ต้องคอยกดคีย์บอร์ดหรือเลื่อนเมาส์เพื่อให้ linux console แสดงผลอยู่ตลอดเวลา
สำหรับวิธีการนั้นก็ไม่ได้ยุ่งยากเลยครับ แค่ใช้คำสั่ง setterm เท่านั้น
setterm -blank 0 -powersave off -powerdown 0 < /dev/console > /dev/console 2>&1
หากต้องการยกเลิก blank screen ทุกครั้งหลังจาก start linux ให้ทำการเพิ่มคำสั่งดังกล่าวในไฟล์ /etc/rc.local เพียงเท่านี้ก็ไม่ต้องคอยกดคีย์บอร์ดหรือเลื่อนเมาส์ทุกๆ 5 นาทีแล้วครับ
Tags: blank screen, centos, concole, debian, linux console, setterm, ubuntu, X window
Posted in CentOS, Operating System, debian, ubuntu | No Comments »
Posted by กวิน ชัยเลิศ on Saturday, June 21st, 2008
มาทำความรู้รักกับ PXE กันก่อนครับ
PXE หรือ Preboot eXecution Environment เป็น Open Standard ที่พัฒนาขึ้นโดย Intel ซึ่ง PXE นี้จะยอมให้ Computer ต่างๆ (Server, PC, Laptop, Notebook ที่ BIOS ลองรับ PXE Booting) สามารถ boot ผ่าน network ได้ไม่ต้องง้อ floppy, cd หรือ dvd กันเลยทีเดียว (มันสุดยอดจริงๆ ครับ)
มาลุยกันเลยครับ
Server : CentOS 5.1 + dhcp + tftp-server + httpd + syslinux
Client : Ubuntu 8.04
เอาเป็นว่าทุกๆ ท่านติดตั้ง CentOS ไว้เป็นที่เรียบร้อย ทีนี้ก็เป็นขั้นตอนการติดตั้ง PXE Server ละครับ
แปลงร่างเป็น root
ติดตั้ง dhcp, tftp-server, httpd และ syslinux
yum install dhcp tftp-server httpd syslinux
เตรียม install files (ผมเลือกติดตั้ง Ubuntu 8.04)
>>วิธี mount iso image บน linux
wget http://ftp.science.nus.edu.sg/linux/ubuntu-ISO/8.04/ubuntu-8.04-server-i386.iso
mkdir -p /var/www/html/mirror/ubuntu/8.04
mount -o loop ubuntu-8.04-server-i386.iso /var/www/html/mirror/ubuntu/8.04
cp -fr /var/www/html/mirror/ubuntu/8.04/install/netboot/* /tftpboot
คลิกที่นี่เพื่อดูส่วนที่เหลือ »
Tags: centos, debian, dhcp, httpd, install, intel, Linux, network booting, network install, open standard, PXE, syslinux, tftp-server
Posted in CentOS, Operating System, debian, ubuntu | 2 Comments »