配置 Apache 的 mod_proxy 支援

執行這項作業的原因和時機
如要配置 Apache HTTP Server 的實例,以支援經由 Proxy 對 CM Server 進行存取,您必須利用 Apache mod_proxy 模組所提供的 Proxy 支援,來配置 Apache HTTP Server。您可上網查詢有關其配置方法的詳細資料,網址為:http://www.apache.org/。以下是您必須採取的步驟摘要:
  1. 配置 Apache HTTP Server 以載入 mod_proxy 模組,以及該伺服器所倚賴的其他模組。您通常需要將 Apache httpd.conf 檔中與 mod_proxy 支援相關的各個 LoadModule 指引解除註解。例如:
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_connect_module modules/mod_proxy_connect.so
    LoadModule proxy_http_module modules/mod_proxy_http.so 
  2. httpd.conf 中,位在 <IfModule mod_Proxy.c> 區塊中的 ProxyRequests On 指引解除註解:
    <IfModule mod_proxy.c>
    ProxyRequests On
    </IfModule>

    若您要配置反向的 Proxy 支援,請將 ProxyRequests 參數值從 On 變更為 Off。若是正向的 Proxy 支援,則保持參數原來的設定:On。將 ProxyRequests 設定為 Off 並不會停用 ProxyPass 指引。

  3. httpd.conf<IfModule mod_proxy.c> 區塊內,新增適當的 ProxyPassProxyPassReverse 指引。ProxyPassProxyPassReverse 指引是應用程式特定的。

    在此範例中,hostname 是 CM Server 伺服器主機的名稱,port 則是選用的埠號,若您變更 CM Server 用來接聽 HTTP 要求的預設埠,就必須指定此埠號(請參閱變更預設 CM Server HTTP 埠)。

    ProxyPass /cqweb/ http://hostname[:port]/cqweb/
    
    ProxyPassReverse /cqweb/ http://hostname[:port]/cqweb/

    比方說,下列指引會配置 Proxy 伺服器,以支援透過 Rational® ClearQuest® Web 介面來存取在名稱為 CMserver_host 之主機的埠 12081 上接聽的 CM Server 程序。

    ProxyPass /cqweb/ http://CMserver_host:12081/cqweb/
    ProxyPassReverse /cqweb/ http://CMserver_host:12081/cqweb/
    註: 在此範例中所指定的網址必須依指定正確寫入 httpd.conf 檔,除了主機名稱與選用的埠號以外。

    針對 ClearQuest Web 介面,在 cqweb 網址中新增下列格式的 ProxyPassProxyPassReverse 指引:

    • ProxyPass /wpf/ http://hostname[:port]/wpf/

      ProxyPass /px/ http://hostname[:port]/px/

      ProxyPass /images/ http://hostname[:port]/images/

      ProxyPass /dct/ http://hostname[:port]/dct/

      ProxyPass /common/ http://hostname[:port]/common/

      ProxyPass /../view/ http://hostname[:port]/view/

      ProxyPass /view/ http://hostname[:port]/view/

      ProxyPass /cqweb/ http://hostname[:port]/cqweb/

      ProxyPass /cqattachments/ http://hostname[:port]/cqattachments/

      ProxyPassReverse / http://hostname[:port]/

      hostname 是 CM Server 伺服器主機的名稱,port 則是選用的埠號,若您變更 CM Server 用來接聽 HTTP 要求的預設埠,則必須指定此埠號。下例支援透過 ClearQuest Web 介面對 CM Server 程序(其是在名稱為 CMServer_host 之主機的埠 12081 上接聽)進行 Proxy 存取。
      ProxyPass         /wpf/ http://CMserver_host:12081/wpf/
      ProxyPass        /px/ http://CMserver_host:12081/px/
      ProxyPass        /images/ http://CMserver_host:12081/images/
      ProxyPass        /dct/ http://CMserver_host:12081/dct/
      ProxyPass        /common/ http://CMserver_host:12081/common/
      ProxyPass        /../view/ http://CMserver_host:12081/view/
      ProxyPass        /view/  http://CMserver_host:12081/view/
      ProxyPass        /cqweb/ http://CMserver_host:12081/cqweb/
      ProxyPass        /cqattachments/ http://CMserver_host:12081/cqattachments/
         ProxyPassReverse / http://CMserver_host:12081/

    當您在 CM Server 主機上安裝新版的 Rational ClearCase®、Rational ClearQuest 或任何其他 IBM® 產品時,IBM 產品的 Web 介面所使用的網址可能會變更。如果要在 CM Server 主機上尋找目前有效的 IBM 產品網址,請檢查 CM Server conf/include 目錄中的 *.conf 檔。應用程式的網址會以引數的形式內嵌在 AliasJkMount 指引中。例如,JkMount /CQWeb/* ajp13 表示 /CQWeb 是 CM Server 支援的網址(省略尾端 /*)。


意見