Archive for the ‘ubuntu’ Category
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 Wednesday, July 2nd, 2008
หลายๆ คนอาจจะสงสัยว่าทำไมไม่มีไฟล์ /etc/inittab อยู่บน ubuntu 8.04 (ที่จริงมันหายไปตั้งแต่ ubuntu 6.10 แล้วละครับ) บางคนอาจจะคิดว่าติดตั้งผิดหรือเผลอลบไปตอนไหน อันที่จริงแล้ว /etc/inittab ไม่ได้หายไปหรอกครับเพียงแต่ ubuntu เปลี่ยนการใช้งาน /sbin/init daemon (System-V init) ไปเป็น Upstart แทน สำหรับผมแล้วรู่สึกว่าการใช้งาน System-V init มันง่ายกว่ากันเยอะเลย … ผมใช้งาน Upstart คล่องเมื่อไหร่จะมาเขียนให้เพื่อนๆ ได้อ่านกันอีกครั้ง
Tags: inittab, ubuntu, ubuntu 8.04, upstart
Posted in Operating System, ubuntu | No Comments »
Posted by กวิน ชัยเลิศ on Tuesday, June 24th, 2008
จากประสบการณ์ที่ผ่านมา default editor บน linux และ *bsd มักจะเป็น vi ซึ่งตามปกติแล้ว system administrator (sysadmin) จำเป็นต้องใช้ default editor ของ os ในหลายๆ เหตุการณ์ เช่น ใช้ในคำสั่ง crontab เป็นต้น
หลังจากที่ติดตั้ง Ubuntu 8.04 hardy ก็พบว่า default editor ไม่ใช่ vi ที่ผมคุ้นเคย กลับกลายเป็น nano editor หน้าตาเหมือนกับ pineapple สมัยที่ linux ยังไม่เฟื่องฟู (pine e-mail client) ไม่รู้ว่าคนแก่แถวๆ นี้มีใครนิยมกิน pine บ้างครับ … เพื่อไม่ให้ยืดเยื้อไปกว่านี้ เรามาเปลี่ยน default editor บน ubuntu กันดีกว่าครับ
คลิกที่นี่เพื่อดูส่วนที่เหลือ »
Tags: debian, default editor, hardy, nano, pine, sysadmin, system administrator, ubuntu, ubuntu 8.04 hardy, vim
Posted in Operating System, 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 »