Sun Cluster 快速入门指南(适用于 Solaris OS)

Procedure如何配置 Apache HTTP Server 软件

本过程使用 mod_ssl 来配置安全 Apache HTTP Server 版本 1.3 软件。有关其他信息,请参见位于 file:///usr/apache/htdocs/manual/index.html.html 的已安装的 Apache 联机文档、位于 http://httpd.apache.org/docs/1.3/ 的 Apache HTTP Server Web 站点,以及位于 http://www.modssl.org/docs/ 的 Apache mod_ssl Web 站点。

  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 服务器正在使用通过 RSA 加密的私钥侦听端口 8080 和 8888。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 启动/停止脚本文件 /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