gpt4 book ai didi

Apache2 SSL 设置适用于静态 IP 但不适用于域名

转载 作者:太空宇宙 更新时间:2023-11-03 14:56:11 25 4
gpt4 key购买 nike

所以我有一个运行 apache2 v2.4.7 的 digital ocean ubuntu 14.04 服务器。我买了一个 namecheap .me 域并将它的 URL 框架指向 DO 服务器的 IP。到目前为止一切正常。然后我注册了一个免费的 StartSSL 证书(注册到 .me 域名),并通过 this tutorial 将它添加到服务器。 ,我唯一没有做的就是将 VirtualHost 80 和 443 保存在同一个文件中。我将 443 放在它自己的 default-ssl.conf 文件中。

现在,如果我转到 http://123.123.123.123http://www.myexample.me 它工作正常。如果我转到 https://123.123.123.123(端口 443 ssl 虚拟主机),它可以工作,但它会警告我,因为证书已注册到 www.myexample.me,没问题。

最后,如果我转到 https://www.myexample.me 它什么都不做,除了 chrome javascript 控制台中的这个

GET https://www.myexample.me/ net::ERR_CONNECTION_REFUSED

这是我的默认 ssl.conf 文件

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName myexample.me:443
DocumentRoot /var/www/html
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /etc/apache2/ssl/ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/private.key
SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>

BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

</VirtualHost>
</IfModule>

当我在添加证书后重新加载 apache 时。我收到了这个错误。

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

所以我将 Servername myexample.me 添加到 apache2.conf 文件的底部,这似乎抑制了错误。

任何指导表示赞赏。如果我错过了发布任何信息,请告诉我。

最佳答案

所以我能够修复它,这是一个非常愚蠢的错误,但如果我发布它以防其他人犯同样的错误。

在 namecheap 的 URLRedirect 设置中,或者您可能使用的任何提供商,我的 URL Redirect 设置被设置为 URLFrame。但它们应该设置为 A(地址)。

感谢所有提供帮助的人。

关于Apache2 SSL 设置适用于静态 IP 但不适用于域名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29041334/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com