這個主題說明如何變更 Apache HTTP Server 2.2 版的配置設定。
開始之前
安裝 Apache 2.2 版和 Web 伺服器外掛程式最新版本。
避免困難: 如果您在
IBM® i 上執行 IBM HTTP Server(採用 Apache 技術),您可以使用手動配置步驟,但建議您使用 IBM Web Administration for
IBM i GUI。
gotcha
![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
Apache HTTP Server 2.2 版有別於 IBM HTTP Server
(採用 Apache 技術)。 IBM i 不支援 Apache HTTP Server。
安裝 Web 伺服器外掛程式之後,您可以使用「Web 伺服器外掛程式配置工具」來配置 Web 伺服器外掛程式。
這個主題說明如何配置 Apache HTTP Server 2.2 版 Web 伺服器。編輯 Web 伺服器配置檔中的其他程序會說明如何配置其他支援的 Web 伺服器。
避免困難: - 如果您使用的 Apache HTTP Server 支援 64 位元定址,您必須使用 WebSphere® Application Server 產品提供的 64 位元 CD,來安裝 Apache Web 伺服器外掛程式二進位檔。如果您使用 32 位元 CD,將會收到錯誤訊息,指出未載入外掛程式二進位檔。
- 如果您使用的 Apache HTTP Server 支援 32 位元定址,必須使用 WebSphere Application Server 產品提供的 32 位元 CD,來安裝 Apache Web 伺服器外掛程式二進位檔。如果您使用 64 位元 CD,將會收到錯誤訊息,指出未載入外掛程式二進位檔。
錯誤訊息範例如下:
httpd: Syntax error on line XXX of /home/apache/conf/httpd.conf: Cannot
load /home/apache/Plugins/mod_was_ap22_http.sl into server: Invalid argument
gotcha
在 Windows 以外的所有平台上,已使用執行緒 worker 多重處理模組 (MPM) 測試該外掛程式。在 Windows 上,已使用預設執行緒 MPM 測試該外掛程式。
外掛程式可以採行
Apache 2.2 prefork MPM,但與 worker MPM 之間最能發揮功效。外掛程式會維護與後端 WebSphere Application Server 之間的連線儲存區,並使用記憶體內快取。當將 Apache 配置成使用單一子程序,且 ThreadsPerChild 值等於 MaxClients 值時,這些外掛程式功能的執行效能最好。外掛程式可以搭配配置了多項子程序的 prefork MPM 或 worker MPM,但會降低效能。
相容性聲明:外掛程式所使用的 Apache HTTP Server 版本,都聲明與 Apache 2.0.47 及更新版本的二進位檔完全相容,亦即,用來建置的編譯器和編譯器選項相容於用來建置外掛程式的編譯器和編譯器選項。
關於這項作業
執行適合您作業系統的 Apache 2.2 配置步驟。
為求清楚明瞭,範例和訊息將以多行顯示。在 Web 伺服器配置檔中,每一項指引需各佔一行。
本端檔案路徑是指 plugin-cfg.xml 檔在應用程式伺服器上的檔案路徑,且該應用程式伺服器位於與 Web 伺服器相同的機器上。遠端檔案路徑是指應用程式伺服器位於遠端機器上時,plugin-cfg.xml 檔的檔案路徑。
在安裝期間,「Web 伺服器外掛程式配置工具」會安裝虛擬的 plugin-cfg.xml 檔,但是這個檔案需要從應用程式伺服器機器上的實際檔案定期傳播。
下列應用程式伺服器本端檔案路徑中的 node_name
是 web_server_name_node
(若為獨立式應用程式伺服器)或 managed_node_name(若為受管理節點)。
在下列步驟中,Web 伺服器定義的名稱是 webserver1。
程序
配置 httpd.conf 檔中的項目。 建議您使用 IBM Web
Administration for IBM i GUI 來配置 httpd.conf 檔。 本端分散式範例
(僅適用於 Network Deployment - Web 伺服器配置在受管理節點中): WebSpherePluginConfig /QIBM/UserData/WebSphere/AppServer/V9/
ND/profiles/profile1/config/cells/my_cell/nodes/
my_managednode/servers/webserver1/plugin-cfg.xml
本端獨立式範例:
WebSpherePluginConfig /QIBM/UserData/WebSphere/AppServer/V9/
ND/profiles/profile1/config/cells/my_cell/nodes/
webserver1_node/servers/webserver1/plugin-cfg.xml
遠端範例:
WebSpherePluginConfig /QIBM/UserData/WebSphere/AppServer/V9/
ND/profiles/httpprofile1/config/webserver1/plugin-cfg.xml
配置 httpd.conf 檔中的項目。 使用下列的 LoadModule 和 WebSpherePluginConfig 指引範例,作為用來配置您檔案的模型:
LoadModule
was_ap22_module /usr/IBM/WebSphere/Plugins/bin/<arch>/mod_was_ap22_http.so
在這個範例中,視 Web 伺服器架構而定,
<arch> 是
32bits 或
64bits。
本端分散式範例:WebSpherePluginConfig
profile_root/config/cells/
dmgrcell/nodes/managednode/servers/webserver1/plugin-cfg.xml
![[Linux]](../images/linux.gif)
配置 httpd.conf 檔中的項目。 使用下列的 LoadModule 和 WebSpherePluginConfig 指引範例,作為用來配置您檔案的模型:
LoadModule
was_ap22_module /opt/IBM/WebSphere/Plugins/bin/<arch>/mod_was_ap22_http.so
在這個範例中,視 Web 伺服器架構而定,
<arch> 是
32bits 或
64bits。
本端分散式範例:WebSpherePluginConfig
profile_root/config/cells/
dmgrcell/nodes/managednode/servers/webserver1/plugin-cfg.xml
![[Solaris]](../images/solaris.gif)
在 Solaris SPARC 64 位元平台上,「Web 伺服器外掛程式配置工具」會同時安裝 Apache 2.2 外掛程式 32 位元和 64 位元版本,不過,它會將 Web 伺服器配置成只使用 32 位元外掛程式。如果 Web 伺服器是 64 位元,您必須依如下所示,在
httpd.conf 檔中配置 LoadModule 指引,以使用 64 位元外掛程式:
LoadModule
was_ap22_module /usr/IBM/WebSphere/Plugins/bin/64bits/mod_was_ap22_http.so
配置 httpd.conf 檔中的項目。 使用下列的 LoadModule 和 WebSpherePluginConfig 指引範例,作為用來配置您檔案的模型:
LoadModule
was_ap22_module /opt/IBM/WebSphere/Plugins/bin/<arch>/mod_was_ap22_http.sl
在這個範例中,視 Web 伺服器架構而定,
<arch> 是
32bits 或
64bits。
本端分散式範例:WebSpherePluginConfig
profile_root/config/cells/
dmgrcell/nodes/managednode/servers/webserver1/plugin-cfg.xml
配置 httpd.conf 檔中的項目。 使用下列的 LoadModule 和 WebSpherePluginConfig 指引範例,作為用來配置您檔案的模型:
LoadModule was_ap22_module
drive:\IBM\WebSphere\Plugins\bin\<arch>\mod_was_ap22_http.dll
在這個範例中,視 Web 伺服器架構而定,
<arch> 是
32bits 或
64bits。
本端分散式範例:WebSpherePluginConfig
profile_root\config\cells\
dmgrcell\nodes\managednode\servers\webserver1\plugin-cfg.xml
結果
已重新配置 Apache 2.2 Web 伺服器。
下一步
會使用原生 GSKIT Secure Sockets Layer (SSL) 加密程式庫。
安裝 Web 伺服器外掛程式時,如果未安裝必要層次的 GSKIT SSL 加密程式庫,就會安裝它。如果您將外掛程式手動複製到新機器,可能就沒有加密後端連線所需的 GSKIT 程式庫。
配置 Web 伺服器之後,就可以在其中安裝應用程式。如需相關資訊,請參閱資訊中心中的「應用程式」一節。
提示: 如果要取消配置 Web 伺服器,請反向執行手動步驟,並移除在這項程序中手動新增的項目。