将门户配置为使用 HTTPS

开发者服务门户 v. 4.17.01

所有 Apigee 推荐的私有云门户安装都需要将门户置于负载均衡器后面。因此,您需要在负载均衡器本身(而非门户)上配置 SSL。因此,您用于配置 SSL 的过程取决于负载均衡器。

如需简要了解如何在门户上使用 SSL,请参阅在门户上使用 TLS。

对于在 Apache 上运行的门户

不过,如有必要,您可以在托管门户的 Web 服务器上配置 SSL。默认情况下,Apigee 会安装 Apache Web 服务器。

  1. 获取 SSL 密钥和证书。
  2. 确保按照开发者服务门户安装中的说明,使用以下命令安装 mod_ssl:
    > yum install mod_ssl
  3. 更新 /etc/httpd/conf/httpd.conf:
    1. 如果您想停用 80 端口上的 HTTP 访问,请搜索“Listen 80”并将其注释掉。
    2. 在文件末尾添加以下几行代码:
      LoadModule ssl_module modules/mod_ssl.so
      Listen 443
  4. 通过修改 /etc/httpd/conf/vhosts/devportal.conf 来设置虚拟主机,以添加以下内容:
    <VirtualHost *:443>
    ServerName localhost
    SSLEngine on
    SSLCertificateFile "<public cert path>"
    SSLCertificateKeyFile "<private key path>"
    DocumentRoot "/var/www/html"
    <Directory "/var/www/html">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>


    此外,如果您不想使用 HTTP,请注释掉现有的 VirtualHost 定义。
  5. 由于 SSL 是在 httpd.conf 中配置的,因此您不需要 ssl.conf:
    > mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.orig
  6. 重启 Apache:
    > service httpd restart
    系统可能会提示您输入密钥文件的口令。

您应该能够通过 SSL 访问该门户。