« Linux LPD Print Server | 首頁 | Linux 自動餵貓機 »
2006年08月22日
網頁的 P2P 應用: CoralCDN
什麼是 CoralCDN?
- The Coral Content Distribution Network Official Website
- Wikipedia: Coral Content Distribution Network
- JeffHung.Blog: Coral - The NYU Distributed Network
一般 User 如何使用 CoralCDN?
使用方法:
- 直接在瀏覽器輸入網址時, 於 hostname 的最後加上 .nyud.net:8080 即可
ex. http://tw.yahoo.com/ → http://tw.yahoo.com.nyud.net:8080/- 如果目的網址不是 80 port, 把 port number 變成網址的一部份即可
ex. http://br.csie.org:8080/ → http://br.csie.org.8080.nyud.net:8080/使用時機:
- 若直接從某站台下載檔案很慢時, 可透過 CoralCDN 連入其他速度較快的結點進行下載
- 無法連入該網站 (站台當機、維修中、頻寬不足), 可用來連結 cache 資料
Apache Web Server 如何將網址自動導向 .nyud.net:8080?
讓網站自動導向到 .nyud.net:8080 的理由:
- 站台所在上載頻寬太小, 可藉由 CoralCDN 分散站台頻寬壓力
- 站台掛點時尚可由分散的 cache 資料提供 User 瀏覽
編輯 httpd.conf:
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteRule ^/(.*)$ http://your.host.name.nyud.net:8080/$1 [L,R]備忘:
- 以上範例係將整個站台所有 URL 全導向到 .nyud.net:8080, 若只需作用於部份網址, 修改 RewriteRule 即可
ex. 只作用於 /abc: RewriteRule ^/abc/(.*)$ http://your.host.name.nyud.net:8080/abc/$1- 若有啟用 VirtualHost, 須將 Rewrite 敘述寫入 <VirtualHost>...</VirtualHost>
- 中括弧內的 L 表示 Last Rule, R 表示 Force Redirect, $1 是「阿拉伯數字 "一"」不是「小寫 L」
更多的說明請見 Apache Web Server 線上文件: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html (這是 httpd 2.x 的說明文件, 若為 httpd 1.x, 將 URL 改成 1.0 即可)
後記:
- CoralCDN 尚在發展初期, 目前可使用的 cache nodes 多以國外為主, 使用時速度也不見得比直接連入目的網站來得快.
- CoralCDN 提供了 Source Code
似乎可以自建 cache node. 不過 coral1 這個套件 make 不起來...?
netpath.C:400: error: `datasize' cannot appear in a constant-expression
Posted by Jamyy at 2006年08月22日 16:36
Trackback Pings
TrackBack URL for this entry:
http://cha.homeip.net/cgi-bin/mt/mt-tb.cgi/222
Comments
站長大大請教一下,.我的HTACCESS內容如下:
RewriteCond %{HTTP_HOST} ^xxx.com.tw$ [OR]
RewriteCond %{HTTP_HOST} ^www.xxx.com.tw$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://www.xxx.com.tw/123/abc [R=301,L]
就是我在ie打,www.xxx.com.tw 會自動執行http://www.xxx.com.tw/123/abc 目錄下的index.htm檔,但是ie 位置也會變http://www.xxx.com.tw/123/abc ,可否設定不要讓ie位置變成http://www.xxx.com.tw/123/abc ,而還是顯示http://www.xxx.com.tw/ 這樣呢?
Posted by: ken at 2007年01月21日 15:34
您好!
如果只是想讓網址不顯示完整的 URL
也可以用 frame 的方式來做
把 www.xxx.com.tw/ 的 index.html 寫成:
<html>
<frameset>
<frame src="123/abc/">
</frameset>
</html>
這樣就能達成您的需求
Posted by: Jamyy at 2007年01月22日 10:05