使用 IBM HTTP Server 而不是 Apache HTTP Server

可以配置 IBM HTTP Server (IHS) 以与管理控制台一起使用,但是强烈建议使用内置的 Apache HTTP Server。

开始之前

关于此任务

本主题描述如何执行以下任务:

  1. 设置预编译的 PHP 文件。
  2. 修改 IBM HTTP Server 配置文件以指向 Build Forge Web 应用程序。
  3. 如果使用代理服务器来访问数据库,请修改 PHP 以使用代理服务器。
  4. 如果使用 SSL,请配置 IHS 以通过 SSL 使用 Build Forge。
  5. Windows 系统:替换 IBM HTTP Server 安装目录中的 libeay32.dll。
  6. AIX 系统:额外设置

设置预编译的 PHP 文件

关于此任务

该任务描述如何找到提供的 PHP 文件,以及如何将它们复制到指定的位置。这些文件位于以下目录中:

  • Windows 系统
    <bfinstall>\ihs_modules
  • UNIX 和 Linux 系统
    <bfinstall>/Platform/ihs_modules

过程

  1. 复制 PHP 模块。 如有必要,创建 modules 目录。
    • Windows 系统
      cd <bfinstall>\ihs_modules\modules\
      copy *.dll C:\Program Files\IBM\HTTPServer\modules
    • UNIX 和 Linux 系统
      cd <bfinstall>/Platform/ihs_modules/modules
      cp libphp5.so /opt/IBM/HTTPServer/modules
  2. 复制 PHP 扩展。 如有必要,创建 extensions 目录。
    • Windows 系统
      cd <bfinstall>\ihs_modules\lib\php\extensions\
      copy *.dll C:\Program Files\IBM\HTTPServer\extensions
    • UNIX 和 Linux 系统
      cd <bfinstall>/Platform/ihs_modules/lib/php/extensions/no-debug-zts-20090626
      cp *.so /opt/IBM/HTTPServer/extensions
  3. 复制提供的 php.ini 文件。 如有必要,创建 conf 目录。
    • Windows 系统
      cd <bfinstall>\ihs_modules
      copy php.ini C:\Program Files\IBM\HTTPServer\conf
    • UNIX 和 Linux 系统
      cd <bfinstall>/Platform/ihs_modules
      cp php.ini /opt/IBM/HTTPServer/conf
  4. 编辑您复制到 conf 目录中的 php.ini 文件,以包含指向 extensions 目录的指针。 添加或替换以下行:
    • Windows 系统
      extension_dir = C:\Program Files\IBM\HTTPServer\extensions
    • UNIX 和 Linux 系统
      extension_dir = /opt/IBM/HTTPServer/extensions
  5. 使用针对您系统的信息编辑 php.ini 文件。 您可以使用针对 Apache HTTP Server 提供的 php.ini 文件作为指南。该文件位于以下位置:
    • Windows 系统
      <bfinstall>\Apache\php\php.ini
    • UNIX 和 Linux 系统
      <bfinstall>/server/apache/conf/php.ini
  6. 添加 php.ini 中使用的所有目录的写访问权。 在 UNIX 和 Linux 系统上,对目录运行以下命令:
    chmod -R 777

编辑 IBM HTTP Server 配置文件

过程

  1. 在服务器安装的 conf 目录中找到 IBM HTTP Server (IHS) 的 httpd.conf 文件。
  2. 修改 DocumentRoot 设置以指向 Build Forge Web 应用程序,如示例中所示。在该示例中,Build Forge 安装目录为 /opt/buildforge
    <VirtualHost *:80>
         ServerAdmin build@yourdomain.com
         DocumentRoot /opt/buildforge/webroot/public
         ServerName ausbuild01.yourdomain.com
         ServerAlias build.yourdomain.com mc.yourdomain.com #optional server aliases
         ErrorLog logs/ausbuild.error_log
         CustomLog logs/ausbuild.access_log common
    </VirtualHost>
  3. 添加与 PHP 相关的条目。
    • Windows 系统
      LoadModule php5_module "C:\Program Files\IBM\HTTPServer\modules\
      php5apache2_2.dll"
      
      <IfModule dir_module>     
         DirectoryIndex index.html index.php
      </IfModule>  
      
      AddType application/x-httpd-php .php 
      
      # PHPIniDir is the location of the php.ini file
      PHPIniDir "C:\Program Files\IBM\HTTPServer\conf"
    • UNIX 和 Linux 系统
      LoadModule php5_module "/opt/IBM/HTTPServer/modules/libphp5.so"
      
      <IfModule dir_module>     
         DirectoryIndex index.html index.php
      </IfModule>  
      
      AddType application/x-httpd-php .php 
      
      # PHPIniDir is the location of the php.ini file
      PHPIniDir "/opt/IBM/HTTPServer/conf"
  4. 为缺省用户更改语句:
    • 如果要使用 AIX 系统,请使用 User daemonGroup staff,而不是使用 User daemonGroup daemon
    • 对于 Linux 系统,更改 <bfinstall>/webroot/templates_c 文件夹内 templates_c 文件中针对 User daemonGroup daemon 的语句。Linux 系统的示例是 chown daemon:daemon /opt/buildforge/webroot/templates_c
  5. 更改针对 templates_c 文件的许可权。 在 Linux 系统上使用 daemon:daemon,在 AIX 系统上使用 daemon:staff。以下是针对 Linux 系统的示例:
    chown daemon:daemon /opt/buildforge/webroot/templates_c
  6. 如果需要,请更改 IHS 端口号。缺省端口号为 80。对 httpd.conf 作出其他任何必要的更改。

识别 PHP 中的代理服务器

关于此任务

仅当管理控制台需要使用代理服务器访问其数据库时,才需执行此步骤。

过程

编辑 PHP 配置文件 php.ini 它位于 <php-install>/lib; 中,例如 /usr/local/php-5.3.6

添加以下条目:

bf_proxyHost=<your_proxy_server_hostname>
bf_proxyPath=<your_proxy_path>
bf_symlinkPath=<symlink_to_proxy_path>

为 IHS 配置 SSL

关于此任务

除了针对 IHS 的常规 SSL 设置外,用于 Build Forge® 时还有额外要求。

过程

  1. 在路径中包含 Build Forge® 工具目录。
    • Windows 系统:
      • bfinstall\ibmjdk\bin
      • bfinstall\openssl
    • Unix 或 Linux 系统:
      • bfinstall/server/ibmjdk/bin
  2. 在库路径中包含 Build Forge® 工具目录。
    • AIX 系统 (LIBPATH):
      • bfinstall/openssl
    • Unix 或 Linux 系统 (LD_LIBRARY_PATH):
      • bfinstall/openssl
  3. Build Forge® 密钥从 PKCS12 转换为 CMS。 使用 GSKIT 工具的最新版本。在 gsk7\bin (Windows) 或 bin(Unix 或 Linux)中,运行以下命令(添加换行符是为了清晰说明):
    gsk7cmd -keydb
            -convert
            -db bfinstall\keystore\buildForgeKeyStore.p12 
            -pw buildForgeKeyStore_password
            -old_format pkcs12
            -new_format cms
  4. 将密码保存到隐藏文件中。 IHS 使用该文件在启动期间获取密码。若无此文件,IHS 会提示输入密码。使用 GSKIT 工具的最新版本。在 gsk7\bin (Windows) 或 bin(Unix 或 Linux)中,运行以下命令(添加换行符是为了清晰说明):
    gsk7cmd -keydb
            -stashpw
            -db bfinstall\keystore\buildForgeKeyStore.kdb 
            -pw buildForgeKeyStore_password
  5. 修改 httpd.conf。 包含以下针对 Windows 的条目。如果希望用户仅使用 https 访问,必须注释掉 Listen 80
    LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
    # Listen 80
    Listen 0.0.0.0:443
    <VirtualHost *:443>
    SSLEnable
    SSLClientAuth None
    SSLProtocolDisable SSLv2 
    SSLServerCert buildforge
    KeyFile bfinstall\keystore\buildForgeKeyStore.kdb
    SSLStashFile bfinstall\keystore\buildForgeKeyStore.sth
    ErrorLog bfinstall\Apache\logs\ssl_error.log
    TransferLog bfinstall\Apache\logs\transfer.log
    </VirtualHost>

    包含以下针对 Unix 和 Linux 的条目。如果希望用户仅使用 https 访问,必须注释掉 Listen 80

    LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
    # Listen 80
    Listen 0.0.0.0:443
    <VirtualHost *:443>
    SSLEnable
    SSLClientAuth None
    SSLProtocolDisable SSLv2 
    SSLServerCert buildforge
    KeyFile bfinstall/Platform/keystore/buildForgeKeyStore.kdb
    SSLStashFile bfinstall/Platform/keystore/buildForgeKeyStore.sth
    ErrorLog bfinstall/server/apache/logs/ssl_error.log
    TransferLog bfinstall/server/apache/logs/transfer.log
    </VirtualHost>

    bfinstall 是安装目录的根目录。 对于上述步骤,在 Unix 和 Linux 系统上,您可能需要将 /Platform 附加到 bfinstall 的末尾,以便能访问正确的目录。您还必须使用正斜杠 (/) 而不是反斜杠 (\) 来将目录分开。

结果

请参阅有关设置 SSL 的 IHS 文档,获取更多信息。

Windows:替换 DLL

关于此任务

如果您正在使用的 IBM HTTP Server 版本低于 V8.0,那么必须将 DLL 替换为 Rational® Build Forge® 随附的 DLL。

过程

在 IBM HTTP Server 安装目录的多个位置中,找到并替换现有 libeay32.dll 文件。
  • 使用 <bfinstall>/openssl 中提供的 libeay32.dll
  • 搜索所有 DLL 实例并将其替换。Windows 2003 中的位置示例为:
    <ihs_install>\Plugins\gsk7\gsk7_32\icc\osslib
    <ihs_install>\gsk7\icc\osslib

结果

替换 DLL 后,HTTP Server 可正常启动。 如果您不将其替换,那么 HTTP Server 会启动失败。

AIX 系统:额外设置

对于 AIX 系统,需要额外设置。

过程


反馈