![[8.5.5.4 或更新版本]](../ng_v8554.gif)
「動態遞送」指令
setup、genPluginCfg 和 genKeystore dynamicRouting 指令動作用來產生外掛程式配置檔和金鑰儲存庫檔。在起始設定之後,可隨時使用 genPluginCfg dynamicRouting 指令動作來重新產生 plugin-cfg.xml 檔。舉例來說,當在新的控制器上啟用動態遞送特性時,或是在新增 Web 伺服器時,就可以使用。genKeystore dynamicRouting 指令動作用來產生金鑰儲存庫檔。每一個 dynamicRouting 指令動作都支援線上說明。
setup
setup dynamicRouting 指令會產生 PKCS12 或 JKS 格式的金鑰儲存庫,以及一或多個 WebSphere® 外掛程式配置檔。金鑰儲存庫含有個人憑證以及 memberRoot 和 controllerRoot 這兩份簽章者憑證,如此就能在 WebSphere 外掛程式和「動態遞送」服務之間進行安全通訊。相同的金鑰儲存庫亦用來傳送 HTTPS 要求給 Liberty 群體成員中的應用程式。外掛程式配置檔含有 <IntelligentManagement> 段落,這用來在 WebSphere 外掛程式中啟用「智慧型管理」。<IntelligentManagement> 段落含有一個代表群體的 <ConnectorCluster> 段落。在 <ConnectorCluster> 段落中,每一個啟用動態遞送特性的控制器各有一個 <Connector> 段落。
如果要取得指令說明,請發出 <Controller root>/bin/dynamicRouting help setup,這會顯示:
說明
setup dynamicRouting 指令會產生金鑰儲存庫,內含在「動態遞送」服務與用戶端之間啟用安全通訊所需要的個人憑證和簽章者憑證。此外也會產生 WebSphere 外掛程式配置檔,內含 <IntelligentManagement> 段落,可在 WebSphere 外掛程式中啟用「智慧型管理」。
用法
dynamicRouting setup [options]
選項
- --host=name
- 必要。目標群體控制器的主機名稱。
- --password[=pwd]
- 必要。目標群體控制器「管理者」使用者的密碼。如果沒有定義任何值,將會提示您。
- --port=num
- 必要。目標群體控制器的 HTTPS 埠號。
- --user=name
- 必要。目標群體控制器的「管理者」使用者。
- --pluginInstallRoot=path
- 必要。Web 伺服器主機上之 WebSphere 外掛程式根目錄的完整路徑。
- --webServerNames=webServerName[,webServerName1]
- 必要。需要產生其 WebSphere 外掛程式配置檔的 Web 伺服器名稱(以逗點區隔)。
- --keystorePassword[=pwd]
- 必要。產生之金鑰儲存庫的密碼。若有指定,但沒有定義任何值,將會提示您。
- --keystoreType=type
- 選用。產生之金鑰儲存庫的類型。預設類型是 JKS。有效值是 JKS 和 PKCS12。
- --certificateSubject=DN
- 選用。產生之 SSL 憑證的 DN。預設 DN 是 CN=<<value of --user argument>>, OU=client, O=ibm, C=us
您可以將 JVM 內容 com.ibm.websphere.dynamicRouting.utility.autoAcceptCertificates 設為 true,以自動信任 SSL 憑證。
以下是當指令與所有必要的引數搭配執行時,所產生的輸出:
./dynamicRouting setup --port=9444 --host=controller1.acme.com --user=admin --password=password --keystorePassword=keypass --pluginInstallRoot=/opt/HTTPServer_Plugins --webServerNames=webServer1,webServer2 --keystoreType=PKCS12
Generating WebSphere plug-in configuration files for web servers webServer1, webServer2
Auto-accepting the certificate chain for target server.
Certificate subject DN: CN=admin, OU=controller1, O=ibm, C=us
Successfully completed MBean request to the controller.
Successfully generated WebSphere plug-in configuration files plugin-cfg-webServer1.xml, plugin-cfg-webServer2.xml
Generating keystore for web servers webServer1, webServer2
Auto-accepting the certificate chain for target server.
Certificate subject DN: CN=admin, OU=controller1, O=ibm, C=us
Successfully completed MBean request to the controller.
Successfully generated keystore plugin-key.p12.
Generated WebSphere plug-in configuration files plugin-cfg-webServer1.xml, plugin-cfg-webServer2.xml for web servers webServer1, webServer2.
Also generated keystore file plugin-key.p12 that enables secure communication between the Dynamic Routing service and clients..
The file contains personal certificate issued to DN CN=admin,OU=client,O=ibm,C=us. Ensure the admin user exists in the user registry and has a role assigned.
If you are using quick start security, add the following line to the controller server.xml file and update the password:
<quickStartSecurity user="admin" "password=""/>
If you are using basic registry, add the following lines to the controller server.xml file and update the password:
<basicRegistry id="basic" realm="ibm/api">
<user name="admin" password=""/>
</basicRegistry>
<administrator-role>
<user>admin</user>
</administrator-role/>
Copy the WebSphere plug-in configuration file to the directory specified in the WebSpherePluginConfig directive in the IBM HTTP Server httpd.conf file. Copy keystore file plugin-key.p12 to a directory on the web server host, and run "gskcmd" to convert the keystore to CMS format and to set personal certificate as the default.
For example:
gskcmd -keydb -convert -pw <<password>> -db /tmp/plugin-key.p12 -old_format pkcs12 -target /tmp/plugin-key.kdb -new_format cms -stash
gskcmd -cert -setdefault -pw <<password>> -db /tmp/plugin-key.kdb -label default
Copy resulting /tmp/plugin-key.kdb, .sth, .rdb files to the directory /opt/HTTPServer_Plugins/config/webServer1
genPluginCfg
這個動作會產生外掛程式配置檔。每一個外掛程式配置檔都含有 <IntelligentManagement> 段落,這用來在外掛程式中啟用「智慧型管理」特性。 <IntelligentManagement> 段落含有一個代表群體的 <ConnectorCluster> 段落。在 <ConnectCluster> 段落中,每一個啟用動態遞送特性的控制器各有一個 <Connector> 段落。--webServerNames 引數中指定以逗點區隔的 Web 伺服器名稱。例如,如果指定 --webServerNames=webServer1,webServer2,會產生 plugin-cfg-webServer1.xml 和 plugin-cfg-webServer2.xml 檔。
如果要取得線上說明,請發出 <Controller root>/bin/dynamicRouting help genPluginCfg,這會顯示:
說明
產生 WebSphere 外掛程式配置檔,其中的 <IntelligentManagement> 段落會在 WebSphere 外掛程式中啟用「智慧型管理」。
用法
dynamicRouting genPluginCfg [options]
選項
- --host=name
- 必要。目標群體控制器的主機名稱。
- --password[=pwd]
- 必要。目標群體控制器「管理者」使用者的密碼。如果沒有定義任何值,將會提示您。
- --port=num
- 必要。目標群體控制器的 HTTPS 埠號。
- --user=name
- 必要。目標群體控制器的「管理者」使用者。
- --pluginInstallRoot=path
- 必要。Web 伺服器主機上之 WebSphere 外掛程式根目錄的完整路徑。
- --webServerNames=webServerName[,webServerName1]
- 必要。需要產生其 WebSphere 外掛程式配置檔的 Web 伺服器名稱(以逗點區隔)。
將 JVM 內容 com.ibm.websphere.dynamicRouting.utility.autoAcceptCertificates 設為 true,以自動信任 SSL 憑證。
以下是當指令與所有必要的引數搭配執行時,所產生的輸出:
./dynamicRouting genPluginCfg --port=9444 --host=controller1.acme.com --user=admin --password=password --pluginInstallRoot=/opt/HTTPServer_Plugins --webServerNames=webServer1
Generating WebSphere plug-in configuration file for web server webServer1
Auto-accepting the certificate chain for target server.
Certificate subject DN: CN=admin, OU=controller1, O=ibm, C=us
Successfully completed MBean request to the controller.
File /home/user1/Liberty/wlp/bin/plugin-cfg.xml exists.
Saving to /home/user1/Liberty/wlp/bin/plugin-cfg.xml.old.
Successfully generated WebSphere plug-in configuration file plugin-cfg.xml
Generated WebSphere plug-in configuration file plugin-cfg.xml for web server webServer1.
Copy the WebSphere plug-in configuration file to the directory specified in the WebSpherePluginConfig directive in the IBM HTTP Server httpd.conf file.
genKeystore
這個動作會產生 PKCS12 或 JKS 格式的金鑰儲存庫。請使用 --keystoreType 動作來指定金鑰儲存庫格式。只有在使用 IBM Java 時,才支援產生 PKCS12 金鑰儲存庫。金鑰儲存庫含有個人憑證以及 memberRoot 和 controllerRoot 這兩份簽章者憑證,如此就能在 WebSphere 外掛程式和「動態遞送」服務之間進行安全通訊。相同的金鑰儲存庫亦用來傳送 HTTPS 要求給 Liberty 群體成員中的應用程式。
如果要取得線上說明,請發出 <Controller root>/bin/dynamicRouting help genKeystore,這會顯示:
說明
產生金鑰儲存庫,內含在「動態遞送」服務與用戶端之間啟用安全通訊所需要的個人憑證和簽章者憑證。
用法
dynamicRouting genKeystore [options]
選項
- --host=name
- 必要。目標群體控制器的主機名稱。
- --password[=pwd]
- 必要。目標群體控制器「管理者」使用者的密碼。如果沒有定義任何值,將會提示您。
- --port=num
- 必要。目標群體控制器的 HTTPS 埠號。
- --user=name
- 指定目標群體控制器的「管理者」使用者。(必要)
- --keystorePassword[=pwd]
- 必要。產生之金鑰儲存庫的密碼。若有指定,但沒有定義任何值,將會提示您。
- --keystoreType=type
- 選用。產生之金鑰儲存庫的類型。預設類型是 JKS。有效值是 JKS 和 PKCS12。
- --certificateSubject=DN
- 選用。產生之 SSL 憑證的 DN。預設 DN 是 CN=<<value of --user argument>>, OU=client, O=ibm, C=us
將 JVM 內容 com.ibm.websphere.dynamicRouting.utility.autoAcceptCertificates 設為 true,以自動信任 SSL 憑證。
以下是當指令與所有必要的引數搭配執行時,所產生的輸出:
./dynamicRouting genKeystore --port=9444 --host=contoller1.acme.com --user=admin --password=password --keystoreType=PKCS12 --keystorePassword
Enter password --keystorePassword:
Re-enter password --keystorePassword:
Generating the plugin-key.p12 keystore...
Auto-accepting the certificate chain for target server.
Certificate subject DN: CN=admin, OU=controller1, O=ibm, C=us
Successfully completed MBean request to the controller.
File /home/user1/Liberty/wlp/bin/plugin-key.p12 exists.
Saving to /home/user1/Liberty/wlp/bin/plugin-key.p12.old.
Successfully generated keystore plugin-key.p12.
Generated keystore file plugin-key.p12 that enables secure communication between the Dynamic Routing service and clients..
The file contains a personal certificate issued to DN CN=admin,OU=client,O=ibm,C=us. Ensure the admin user exists in the user registry and has a role assigned.
If you are using quick start security, add the following line to the controller server.xml file and update the password:
<quickStartSecurity user="admin" password=""/>
If you are using basic registry, add the following lines to the controller server.xml files and update the password:
<basicRegistry id="basic" realm="ibm/api">
<user name="admin" password=""/>
</basicRegistry>
<administrator-role>
<user>admin</user>
</administrator-role/>
Copy the WebSphere plug-in configuration file to the directory specified in the WebSpherePluginConfig directive in the IBM HTTP Server httpd.conf file. Copy keystore file plugin-key.p12 to a directory on the web server host, and run "gskcmd" to convert the keystore to CMS format and to set personal certificate as the default.
For example:
gskcmd -keydb -convert -pw <<password>> -db /tmp/plugin-key.p12 -old_format pkcs12 -target /tmp/plugin-key.kdb -new_format cms -stash
gskcmd -cert -setdefault -pw <<password>> -db /tmp/plugin-key.kdb -label default
Copy resulting /tmp/plugin-key.kdb, .sth, .rdb files to the keyring directory specified in the plug-in configuration file.