Add SPDY support to Apache web server with mod_spdy

Posted In Web Server - By Tum. On Saturday, June 23rd, 2012 With 0 Comments

google-spdy-protocol
SPDY (speedy) เป็น networking protocol สำหรับเวปที่ถูกพัฒนาโดย Google เพื่อช่วยลดเวลาการโหลดหน้าเวปและเพิ่มความปลอดภัยให้กับเวป SPDY กำลังถูกพลักดันให้เป็น standard protocol และในปัจจุบันก็เป็น Internet Draft เป็นที่เรียบร้อยแล้ว สำหรับ browser ที่รองรับการทำงานในตอนนี้ก็มี Google Chrome และ Mozilla Firefox

ข้อดีของ SPDY (speedy):

  • web server และ browser สามารถ compress HTTP headers เพื่อช่วยลดการส่งข้อมูล
  • ถ้าหากเรียกใช้งานทรัพยากรหลายตัวสามารถรวมการเรียกใช้ให้เป็น 1 TCP connection เพื่อช่วยลด connections บน network
  • Browser สามารถขอแหล่งข้อมูลหน้าทั้งหมดในครั้งเดียว ซึ่งจะช่วยลดจำนวนรอบการรับส่งข้อมูลระหว่าง web server และ browser

การ config ให้ Apache web server รองรับการทำงาน SPDY protocol

  1. Apche ต้องรันแบบ Worker MPM ตัวอย่างเช่น รันด้วย mod_fcgid
  2. Install Apache webserver, mod_ssl และ openssl:
  3. เนื่องจาก SPDY protocol ใช้ https ในการทำงาน ดังนั้นเราจึงต้องสร้าง certificate ขึ้นมาเพื่อให้รองรับการทำงานแบบ https (ไม่สามารถทำงานแบบ http ได้)
      • สร้าง private key:
      • สร้าง CSR:
      • สร้าง Self Signed Key:
      • Copy ไฟล์ทั้งหมดไปไว้ที่ /etc/http/ssl
      • สร้าง virtual host ให้รองรับการทำงานแบบ https
    • Download SPDY (mod_spdy) ด้วยคำสั่ง
      • SPDY (mod_spdy) สำหรับ 32bit:
      • SPDY (mod_spdy) สำหรับ 64bit:
    • Install mod-spdy for Apache
    • ทำการตรวจสอบความถูกต้องของ config ด้วยคำสั่ง
    • Restart apache service ด้วยคำสั่ง

การทดสอบ SPDY ว่า apache server ได้เปิดให้ใช้งาน SPDY หรือยัง ให้เปิด Chrome และเข้าไปที่

[text]chrome://net-internals/#spdy[/text]

Video ทดสอบ speed ของ https กับ SPDY (mod_spdy)

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*