「管理中心」是一個 Web 使用者介面,在 Liberty 8.5.5.2 版及更新版本的伺服器上執行。安裝 Liberty 並建立伺服器之後,請配置 server.xml 檔。
開始之前
使用「Liberty 管理中心」(簡稱「管理中心」)來安裝 WebSphere® Application Server Liberty。安裝 Liberty Repository 資產主題會列出「管理中心」等資產的安裝方法。安裝「管理中心」最快的方法是執行
installUtility 指令或 featureManager 指令:
- 如果您還沒有這麼做,請安裝 WebSphere Application Server Liberty 8.5.5.2 或更新版本。
限制: 請確定您使用的 Java 虛擬機器 (JVM) 支援 Liberty 產品和 Secure Sockets Layer (SSL)。請勿使用隨附於 WebSphere Application Server 傳統版 產品(例如 Network Deployment)的 IBM JVM,來以「管理中心」進行 Liberty 安裝。依預設,傳統產品隨附的 IBM JVM,會指向只隨附於傳統產品的安全類別,而不會指向「管理中心」所需的安全類別。
使用隨附於傳統產品的 IBM JVM 會導致「管理中心」無法顯示在瀏覽器中。
- 在 Liberty 安裝架構的主目錄中開啟指令視窗。例如,在 c:\wlp 中開啟指令視窗。
- 執行指令,以安裝 adminCenter-1.0 特性。
若為 8.5.5.6 版或更新版本,請執行
installUtility 指令:
bin/installUtility install adminCenter-1.0
若為
8.5.5.5 版或更舊版本,請執行
featureManager 指令:
bin/featureManager install adminCenter-1.0 --when-file-exists=ignore
如需相關資訊,請前往 WASdev 網站,選取 Downloads 標籤,並在 Liberty Repository 中搜尋「管理中心」資產
如果要在無法存取網際網路型 Liberty Repository 的主機上安裝「管理中心」,請先在可以存取網際網路的主機上安裝 Liberty 和「管理中心」特性。然後將安裝架構轉移至目標主機。下列資訊討論包裝。
關於這項作業
您可以將「管理中心」設定在獨立式伺服器和群體控制器上。這個主題的重點放在設定獨立式 Liberty 伺服器。
如果要在群體控制器上啟用「管理中心」,請參閱配置 Liberty 群體。
確定群體控制器的 server.xml 檔在特性管理程式配置中包含 <feature>adminCenter-1.0</feature>,並在 httpEndpoint 元素中設定 host 值,例如 host="*",讓所有主機都可以存取群體控制器。
程序
- 如果您的 Liberty 安裝架構沒有伺服器,請建立 Liberty 伺服器。
例如,在 wlp/bin 目錄的指令視窗中,建立名為 myServer 的伺服器。
server create myServer
範例指令會將伺服器檔案新增至 wlp/usr/servers/myServer 目錄。
- 在編輯器中開啟 Liberty 伺服器的 server.xml 檔,然後為「管理中心」配置伺服器。
- 將 adminCenter-1.0 特性新增至特性管理程式。
<featureManager>
<feature>adminCenter-1.0</feature>
</featureManager>
如果要更適時地更新「探索」工具中的伺服器和應用程式狀態,也請在伺服器配置中新增
websocket-1.1 或 websocket-1.0 特性。
<featureManager>
<feature>adminCenter-1.0</feature>
<feature>websocket-1.1</feature>
</featureManager>
不論大小為何,WebSocket 都提供即時的拓蹼視圖。如果沒有 WebSocket 特性,「管理中心」會定期經常地輪詢是否有變更。
- 新增一或多位使用者,以配置安全登入。 例如:
<quickStartSecurity userName="admin" userPassword="adminpwd" />
如果使用者名稱或密碼包含非英文字元,請針對伺服器建立
jvm.options 檔,並將預設用戶端編碼定義為 UTF-8:
-Ddefault.client.encoding=UTF-8
如需
jvm.options 檔的相關資訊,請參閱
自訂 Liberty 環境。
- 如果要保護具有伺服器鑑別認證的金鑰儲存庫檔,請定義金鑰儲存庫,並為其指定密碼。
<keyStore id="defaultKeyStore" password="Liberty" />
如需其中定義「管理者」和「非管理者」,以及定義金鑰儲存庫的 server.xml 檔案範例,請參閱這個主題中的範例。如需定義多位管理使用者的相關資訊,請參閱範例:在 Liberty 中使用 BasicRegistry 與角色對映。
- 如果要從智慧型手機、平板電腦或遠端電腦存取「管理中心」,請確定 server.xml 檔案將 httpEndpoint 元素的 host 屬性設為 *(星號)或所定義的主機名稱。依預設,host 屬性設為 localhost。
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080"
httpsPort="9443" />
- 儲存您對 server.xml 檔的變更。
如果您已在 jvm.options 檔中針對非英文字元,將預設用戶端編碼定義為 UTF-8,且使用者登錄存在於 server.xml 檔的 quickStartSecurity 或 basicRegistry 元素中(其中儲存使用者名稱與密碼),請以 UTF-8 編碼儲存 server.xml 檔。
- 如果伺服器不在執行中,請啟動伺服器。
例如,在 wlp/bin 目錄的指令視窗中,輸入 run 或 start 指令。
server run myServer
尋找顯示 adminCenter Web 應用程式正在執行的伺服器訊息。「管理中心」開始執行之後,您可以將 Web 瀏覽器指向應用程式,並且登入。請參閱 登入管理中心。
觀看:設定管理中心視訊會示範該程序。[文字稿]
範例:定義兩位獲授權使用者的 server.xml 檔
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>adminCenter-1.0</feature>
</featureManager>
<!-- Define the host name for use by the collective.
If the host name needs to be changed, the server should be
removed from the collective and re-joined. -->
<variable name="defaultHostName" value="localhost" />
<!-- Define an Administrator and non-Administrator -->
<basicRegistry id="basic">
<user name="admin" password="adminpwd" />
<user name="nonadmin" password="nonadminpwd" />
</basicRegistry>
<!-- Assign 'admin' to Administrator -->
<administrator-role>
<user>admin</user>
</administrator-role>
<keyStore id="defaultKeyStore" password="Liberty" />
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080"
httpsPort="9443" />
</server>