【问题标题】:Google Compute Engine Impossible SSL CertificatesGoogle Compute Engine 不可能的 SSL 证书
【发布时间】:2016-01-20 14:49:36
【问题描述】:

我正在尝试在安装了 LAMP 堆栈的 Google Compute Engine 服务器上安装 SSL 证书。

我已在端口 443 上为 https 启用 tcp 流量。我在实例控件上启用了 HTTPS。

我已将 /etc/apache2/sites-enabled/lamp-server.conf 修改如下:

<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  DocumentRoot /var/www/html
  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>
  <Directory /var/www/html/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  </Directory>
  ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
  </Directory>
  ErrorLog ${APACHE_LOG_DIR}/error.log
  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel warn
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost MYINSTANCESTATICIP:443>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/html
ServerName www.MYDOMAIN.com
SSLEngine on
SSLCertificateFile /var/www/ssl/SSLCertificateFile.crt
SSLCertificateKeyFile /var/www/ssl/SSLCertificateKeyFile.key
SSLCertificateChainFile /var/www/ssl/SSLCertificateChainFile.crt
</VirtualHost>
</IfModule>

为什么这不起作用?它应该工作....

【问题讨论】:

  • 请解释一下“不工作”是什么样的。还要查看您的 ErrorLog 文件:${APACHE_LOG_DIR}/error.log 以获取线索。
  • 我使用 http 访问该页面,它可以正常工作。我使用 https 访问该页面并得到 ERR_CONNECTION_REFUSED
  • [2016 年 1 月 20 日星期三 06:33:46.667547] [mpm_prefork:notice] [pid 950] AH00163: Apache/2.4.10 (Debian) 已配置 -- 恢复正常操作
  • 我看到 &lt;IfModule mod_ssl.c&gt; 但我没有看到 LoadModule ssl_module /some/path/mod_ssl.so
  • 很确定您需要加载 SSL 模块。你能做到apachectl -t -D DUMP_MODULES 并在输出中寻找ssl_module 吗?

标签: ssl google-compute-engine


【解决方案1】:

您可以使用sudo apachectl configtest 查看配置错误。

您的配置文件看起来不错。请尝试以下步骤:

  1. 运行sudo a2enmod ssl 命令以启用 Apache 的 SSL 模块。
  2. 重启Apache服务:sudo service apache2 restart
  3. 使用开发者控制台,转到Compute Engine -&gt; VM instances,单击您的 LAMP 虚拟机并确保虚拟机实例被http-serverhttps-server 标记,它们是 tcp:80 和 tcp:443 GCE 防火墙规则的目标标记。

【讨论】:

猜你喜欢
  • 2017-01-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-10-12
  • 2020-09-17
  • 2017-05-28
相关资源
最近更新 更多