http://wutthiphan.com <<– ถนนเส้นนี้ กลับบ้าน

Life, Computers, Travelog, Blogging & IgA Nephropathy…

Sunday
Apr 6,2008

โปรแกรม motion ที่ผมใช้งานอยู่นั้นเมื่อจะเอาภาพออกมาแสดงจะเป็นการ stremming ผ่านทาง TCP port เช่น 8001, 8002, 8003 เป็นต้น ซึ่งในการใช้งานก็เป็นอุปสรรคพอสมควร ถ้าหากปลายทางที่จะเรียกเข้ามาใช้งาน และที่ปลายทางแห่งนั้นมีการติดตั้งไฟร์วอลล์ ก็อาจจะไม่สามารถใช้งานได้ เพราะจากถูกปิดพอร์ท แรกๆนั้นผมใช้วีธีเขียนกำกับไว้ว่า “ถ้าหากไม่เห็นภาพเคลื่อนไหว อาจจเป็นไปได้ว่าคุณนั้นอยู่ภายใต้ไฟร์วอลล์” แน่นอนมันไม่ได้ช่วยให้เห็นภาพวีดีโอจากโปรแกรม motion เลย - -” ก็ได้ปล่อยปะละเลยมาเป็นปีๆ ไม่เคยจะแก้ไขปรับปรุงอะไร จนวันนี้มีงานชิ้นนึงทำให้ผมได้ใช้งานโมดูลของ apache ตัวหนึ่งชื่อว่า “mod_proxy” เลยคิดเอามาประยุคใช้กับโปรแกรม motion ของผมด้วยเลย

มาเริ่มต้นกันจากapache ที่ผมใช้งานเป็น apache2 (V.2.24) เริ่มโดยการโหลดโมดูล mod_proxy โดยการคัดลอกไฟล์ proxy.conf, proxy.load และ proxy_http.load จากพาร์ท mods-available มาไว้ที่พาร์ท mods-enabled จากนั้นทำการแก้ไขไฟล์ proxy.conf โดยตัวอย่างการใช้งานของผม โปรแกรม motion ทำงานอยู่บนเครื่องเดียวกันกับ apache2 ไฟล์ proxy.conf จึงได้ตามนี้

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<ifmodule mod_proxy.c>
 
        ProxyRequests Off
 
        <proxy *>
                AddDefaultCharset off
                Order deny,allow
                #Deny from all
                Allow from all
        </proxy>
 
        ProxyTimeout 30
        ProxyVia On
        ProxyPass /webcam/live/1 http://localhost:8001
        ProxyPass /webcam/config/1 http://localhost:8000/1/config/list
 
        ProxyPass /webcam/live/2 http://localhost:8002
        ProxyPass /webcam/config/2 http://localhost:8000/2/config/list
 
        ProxyPass /webcam/live/3 http://localhost:8003
        ProxyPass /webcam/config/3 http://localhost:8000/3/config/list
 
        ProxyPass /webcam/live/4 http://localhost:8004
        ProxyPass /webcam/config/4 http://localhost:8000/4/config/list
 
</ifmodule>

เสร็จขั้นตอนด้านบนแล้ว ก็ลองสั่งให้ apache2 reload ดู ถ้าไม่มีปัญหาลองสั่ง apache2 -M ควรจะเห็น โมดูล proxy_module, proxy_http_module ถูกโหลดขึ้นมา

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 dir_module (shared)
 env_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 proxy_module (shared)
 proxy_http_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 ssl_module (shared)
 status_module (shared)
 userdir_module (shared)
Syntax OK

เอาล่ะเรียบร้อย ก่อนหน้านั้นการเข้ามาดูทำได้โดยเข้ามาที่ URL เช่น http://wutthiphan.com:8001 , http://wutthiphan.com:8002 , http://wutthiphan.com:8003 , http://wutthiphan.com:8004 โดยมากถ้าที่ไหนมีไฟร์วอลล์มักจะโดนบล๊อก หลังจากทำขั้นตอนข้างบนนี้แล้วการเข้ามาดูจะสามารถเข้ามาดูผ่าน URL เช่น http://wutthiphan.com/webcam/live/1 , http://wutthiphan.com/webcam/live/2 , http://wutthiphan.com/webcam/live/3 , http://wutthiphan.com/webcam/live/4

ได้อย่างนี้ อยู่ที่ไหนก็ดูได้แล้วครับ (ขอให้มีอินเตอร์เน็ตนะครับ) ลองเข้าไปดูที่ใช้งานอยู่ได้เลยครับ

กล้องตังที่1 , กล้องตัวที่2 , กล้องตัวที่3 และ กล้องตัวที่4

wutthiphan.com แปลงร่าง

Thursday
Apr 3,2008

อะแฮ่ม.. ใช้Theme connection เดิมมาเป็นเวลาอันยาวนาน ประมาณปีกว่าๆ พอดีว่าวันนี้แว็บๆท่องหา Themeสวยๆทำเว็บให้ลูกค้า แล้วดันไปตกหลุมรักเจ้าTheme morning(ที่ใช้อยู่ปัจจุบัน)นี้เข้าให้ เลยเอามาใช้เองเลย..

รูปtheme connectionเดิม

อาจจะเป็นว่าช่วงนี้ตื่นแต่เช้า เจอบรรยากาศเช้าๆแล้วสดชื่น เลยชอบthemeนี้เลย..

Upgrade WordPress 2.5-RC1 (Sneak Peek)

Thursday
Mar 20,2008

เมื่อสองวันก่อน (18 มีนาคม 2551) matt ได้ประกาศ WordPress 2.5-RC1 โค๊ดแนม Sneak Peek พอดีช่วงนี้ว่างๆเลยลองเอามาลงทดสอบดูกับเว็บบล๊อกของตัวเองดู เรียกว่าหางานให้ตัวเองทำว่างั้นเถอะ รายละเอียดขี้เกียจเขียนไปดูกันได้เลยที่ http://wordpress.org/development/2008/03/25-sneak-peek/ ส่วนการอัพเกรดนั้นทำตามนี้

  1. แบคอัพข้อมูลทั้งไฟล์และเดต้าเบสเก็บไว้ก่อนกันเหนียว
  2. แตกไฟล์ออกมา
  3. แก้ไขไฟล์ wp-config-sample.php ให้เหมือนกับไฟล์ wp-config.php ที่ใช้งานอยู่ แล้วบันทึกเป็นชื่อ wp-config.php
  4. อัพโหลดโลด
  5. เปิดเว็บไปที่ http://เว็บของคุณ.com/wp-admin/upgrade.php ขั้นตอนนี้จะมีการอัพเกรดโครงสร้างของเดต้าเบสด้วย คลิกเม้าส์สองสามทีก็เสร็จ
  6. ใช้งานได้ปกติ แต่ถ้าไม่ปกติ เช่น ภาษาไทยใช้งานไม่ได้(หนอนเต็มหน้าจอยึกยือไปหมด) ไม่ต้องตกใจเปิดไฟล์ wp-includes/wp-db.php ขึ้นมาแล้วแก้ใขตามนี้

โดยแก้ใขที่บรรทัดที่ 86

1
2
3
4
5
if ( !empty($this-&gt;charset) &amp;&amp; version_compare(mysql_get_server_info($this-&gt;dbh), '4.1.0', '&gt;=') )
$this-&gt;query("SET NAMES '$this-&gt;charset'");
 
$this-&gt;select($dbname);
}

เป็นตามนี้

1
2
3
4
5
if ( !empty($this-&gt;charset) &amp;&amp; version_compare(mysql_get_server_info($this-&gt;dbh), '4.1.0', '&gt;=') )
$this-&gt;query("SET NAMES '$this-&gt;utf8'");
 
$this-&gt;select($dbname);
}

จากการใช้งานก็ค่อนข้างชอบนะครับมีอะไรใหม่ๆเยอะเหมือนกัน แต่อาจจะมีปัญหาบ้างกับ plugins บางตัว วันนี้เอาแค่นี้ ไปนอนล่ะ

บทความเก่า


คอมเม้นท์ล่าสุด


บทความล่าสุด


ปฎิทิน

May 2008
S M T W T F S
« Apr    
 123
45678910
11121314151617
18192021222324
25262728293031

มีเดียล่าสุด

Get the Flash Player to see the wordTube Media Player.

เมนูผู้ใช้


แท็ก


Blogroll


My Site


Other


Web I Read


Spam Blocked