驚艷於一個相容於ColdFusion,但是可免費商用的Railo,跌跌撞撞的研究過程,希望能有同好一起交流指教。

2009年9月8日 星期二

Output Control - 空白字元與版本資訊

我們可以進一步微調 Railo中的設定,關於 Output控制:

筆者建議設定:


設定路徑: Web Administrator > Settings > Output > Railo output control
以及 Server Administrator > Settings > Output > Railo output control 都要進行同樣設定


1. Whitespace management 空白字元管理 -
 Removes all white spaces in the output that follow a white space移除全部的空白字元,此設定可以大幅度減少頻寬的消耗(對於動態網頁來說很容易產生大量的空白)。

筆者過去在其他環境下(.asp .php .jsp/Linux windows 2K),曾使用其他硬體或第三方軟體移除空白的功能,在某些特定環境組合下的瀏覽器會有顯示不正常的問題;但在Railo中尚未遇到此狀況,如果有遇到客戶反應,可嘗試關掉此功能測試。

但是節省下的頻寬/速度來說,筆者認為此功能相當值得啟動。



我們用一個簡單的範例解釋: (以 "九九乘法表" 程式為例; 很多人都是從這個開始第一個程式吧? :D )

程式原始碼
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="font.css" rel="stylesheet" type="text/css" />
<title>空白字元測試</title>
</head>
<body>
<CFOUTPUT>
  <CFLOOP index="i" from="1" to="9">
    <CFLOOP index="j" from="1" to="9">
       #numberformat(i,"00")# * #numberformat(j,"00")# = #numberformat((i*j),"00")#<br />
    </CFLOOP>
    <hr />
  </CFLOOP>
</CFOUTPUT>
</body>
</html>


畫面輸出結果:


我們再來看原始碼的內容做比較,
勾選移除空白字元:


未勾選狀態: (將資料反白後可以看得更清楚)



2.Output Railo version 顯示Railo版本 -
 Return the Railo version in the response header在HTTP header中顯示Railo版本資訊,基於安全的理由,建議關閉此選項。

我們用 Tenlet 127.0.0.1 8600 來檢查
未勾選回傳版本資訊:


勾選回傳版本資訊:

2009年9月3日 星期四

取得Railo無人數限制金鑰步驟 (Railo Community)

Railo 目前一共有三個版本,開發版/社群版/企業版,如果沒有輸入金鑰(serial number)下,會自動變成開發版。

官方原文介紹如下:


The different product levels are a result of the used serial number which you receive from the customer center. If you don't use a serial number you are going to get the Develop Version automatically. (see below)

Railo develop
The Develop Version is a version, addressing those users who are most likely to apply it in order for assembling CFML application . The version though is prohibited to be used commercially.

Railo community
Railo Community is intended to be used by low budget business applicants. The Community Version offers the entire language range of Railo except for some features listed below.

Railo enterprise
The Enterprise Version of Railo is the biggest and most comprehensive version intended to be used in a larger context.



三個版本的差異如下:
Railo Develop開發版 - 同一時間最多10個不能IP使用,而且基本上這個版本是禁止用來商業使用。
Railo Community社群版 - 無使用人數上限,只要註冊就能免費取得,授權範圍在單一伺服器上以及大部分的功能。與企業版差異在:
*限制部分管理功能
*沒有多媒體功能
*沒有管理同步
*沒有叢集功能
*未經官方同意不能散佈

Railo enterprise企業版 - 目前Railo最高等級產品,擁有最完整的功能,包含多媒體功能、多伺服器管理、叢集管理等。

這篇主要步驟是示範如何取得Railo Community社群版的金鑰。
1. 到 Railo官網後,點選"Customer Center"頁籤,勾選 [I'm a new customer] 選項


2. 輸入註冊資料,打*號的地方是必填的。(如需要可參考中文地址英譯)


3. 註冊成功後,點左邊 "Licenses"次頁,再點[get new license]


4. 選擇第一個 Railo Community 3.0,可以看到最後的價格是 $0.00 (企業版是美金$2999.00)


5. 成功後就可以看到一組序號,複製後在Railo管理介面中輸入,即可從開發版升級為社群版