Sun Cluster 快速入門指南 (適用於 Solaris 作業系統)

Procedure配置 Apache HTTP Server 軟體的方式

此程序使用 mod_ssl 來配置安全的 Apache HTTP Server 版本 1.3 軟體。如需其他資訊,請參閱 file:///usr/apache/htdocs/manual/index.html.html、Apache HTTP Server 網站 (http://httpd.apache.org/docs/1.3/) 以及 Apache mod_ssl 網站 (http://www.modssl.org/docs/) 上已安裝的 Apache 線上文件。

  1. 使用 cconsole 主視窗來存取兩個節點。

    您可以在兩個節點上同時執行接下來的步驟。

  2. 修改 /etc/apache/httpd.conf 配置檔案。

    1. 如有需要,請將 /etc/apache/httpd.conf-example 範本複製成為 /etc/apache/httpd.conf

    2. 設定下列指令:

      Apache 指令 

      值 

      ServerType

      Standalone

      ServerName

      apache-lh

      DocumentRoot

      /var/apache/htdocs

  3. 安裝所有憑證和金鑰。

  4. /usr/apache/bin 目錄中,建立檔案 keypass

    將檔案權限設為僅限所有者存取。


    phys-X# cd /usr/apache/bin
    phys-X# touch keypass
    phys-X# chmod 700 keypass
    
  5. 編輯 keypass 檔案使其列印對應到主機和連接埠的加密金鑰之通關片語。

    此檔案將以 server:port algorithm 作為引數來呼叫。當使用正確的參數呼叫時,請確認檔案能夠列印您每個加密金鑰的通關片語。

    稍後,當您嘗試手動啟動 web 伺服器時,不應出現需要通關片語的提示。例如:假設有一個安全的 web 伺服器正在偵聽連接埠 8080 和 8888,而這個兩個連接埠皆使用 RSA 加密的私密金鑰。keypass 檔案可能如下所示:


    # !/bin/ksh
    host=`echo $1 | cut -d: -f1`
    port=`echo $1 | cut -d: -f2`
    algorithm=$2
    
    if [ "$host" = "apache-lh.example.com" -a "$algorithm" = "RSA" ]; then
       case "$port" in
       8080) echo passphrase-for-8080;;
       8888) echo passphrase-for-8888;;
       esac
    fi
  6. 在 Apache start/stop 程序檔 /usr/apache/bin/apachect1 中更新路徑 (如果它們與您的 Apache 目錄結構不同)。

  7. 驗證您的配置變更。

    1. 檢查 /etc/apache/httpd.conf 檔案的語法是否正確。


      phys-X# /usr/apache/bin/apachectl configtest
      
    2. 確認已配置 Apache 使用的邏輯主機名稱或共用位址且為上線狀態。

    3. phys-sun 上啟動 Apache 伺服器。


      phys-sun# /usr/apache/bin/apachectl startssl
      
      • 請確認 web 伺服器不會要求您輸入通關片語。

      • 若 Apache 無法正常啟動,請將問題修正。

    4. phys-sun 上停止 Apache 伺服器。


      phys-sun# /usr/apache/bin/apachectl stopssl