apache - 在带有 apache2 的 ubuntu 上使用 SSL 证书会导致 ERR_ADDRESS_UNREACHABLE
问题描述
尝试使用我从提供商处获得的 ssl 证书和密钥,但没有成功。当我想连接到我的网站时,我会ERR_ADDRESS_UNREACHABLE
在 Google Chrome 中获得一个。
这是我的网站的 Apache 配置。
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
ServerAdmin me@example.com
DocumentRoot /var/www/example.com/public
Redirect "/" "https://example.com/"
ErrorLog ${APACHE_LOG_DIR}/example.com.error.log
CustomLog ${APACHE_LOG_DIR}/example.com.access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName example.com
ServerAlias *.example.com
ServerAdmin me@example.com
DocumentRoot /var/www/example.com/public
SSLEngine on
SSLCertificateFile /etc/ssl/certs/example.com.crt
SSLCertificateKeyFile /etc/ssl/private/example.com.key
<Directory /var/www/example.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
<Limit POST PUT DELETE>
Require all granted
</Limit>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example.com.error.log
CustomLog ${APACHE_LOG_DIR}/example.com.access.log combined
</VirtualHost>
</IfModule>
我还确保防火墙允许 https 连接。
我在这里想念什么?
解决方案
好的,奇怪的是我的服务器上确实没有启用 ssl/https/port 443。不知道为什么一切都告诉我启用了 https,但这是我可以为我解决的方法。
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
推荐阅读
- azure - Azure ARM 模板跳过嵌套条件
- python - Tensorflow:FailedPreconditionError:找不到所需的函数定义
- azure-cognitive-search - 如何使用 REST API 创建 Azure 搜索索引器
- c# - 如何在父(调用者)方法中覆盖 Catch(异常)?
- c# - 为什么我们需要 OperationAuthorizationRequirement 在 ASP.NET Core 中进行基于资源的授权?
- optimization - 优化、时间复杂度和流程图 (Scilab)
- javascript - Axios Ajax,从调用 API 返回未定义
- angular - 为什么我收到这些错误“没有路径的表单控件的值访问器:'rowDetails -> 0 -> no'”
- mysql - 有可能:“SELECT COUNT (*) < SELECT COUNT (VALUE)?”
- python - 尝试在 python 上安装 docplex 命令出错,退出状态为 1:python setup.py egg_info 检查日志以获取完整的命令输出