mydomainname.com 无法使用 https

发布于 2024-10-19 04:19:35 字数 1054 浏览 5 评论 0原文

我创建了一个自签名 SSL 证书用于测试目的,并在我的虚拟主机文件中配置了生成的证书。但是,当我尝试使用 https://mydomainname.com 访问我的域时,它不起作用。 Mozilla给出错误页面

Firefox 无法建立连接 到 mydomainname.com 的服务器。

我有一台 Windows Vista 计算机,我的虚拟主机文件如下:

我的虚拟主机文件:

<IfDefine SSL>
 <VirtualHost mydomainname.com:80>
       #ServerName www.mydmainnamw.com:8080
       #DocumentRoot "C:/.../My Company/My Sites/johnbokma.com/site/web"
       #CustomLog logs/lc.johnbokma.com.access.log combined
       #ErrorLog logs/lc.johnbokma.com.error.log

       SSLEngine on
       SSLCertificateFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.crt/server.crt 
       SSLCertificateKeyFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.key/server.key

       SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
       CustomLog logs/ssl_request_log \
       "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

 </VirtualHost>
<IfDefine SSL>

I have created a self signed SSL Certificate for testing purpose and I have configured the generated certificate at my virtual hosts file. But when I tried to access my domain with https://mydomainname.com it's not working. Mozilla gives the error page

Firefox can't establish a connection
to the server at mydomainname.com.

I have a Windows Vista machine and my virtual hosts file is following:

my vitual hosts file:

<IfDefine SSL>
 <VirtualHost mydomainname.com:80>
       #ServerName www.mydmainnamw.com:8080
       #DocumentRoot "C:/.../My Company/My Sites/johnbokma.com/site/web"
       #CustomLog logs/lc.johnbokma.com.access.log combined
       #ErrorLog logs/lc.johnbokma.com.error.log

       SSLEngine on
       SSLCertificateFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.crt/server.crt 
       SSLCertificateKeyFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.key/server.key

       SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
       CustomLog logs/ssl_request_log \
       "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

 </VirtualHost>
<IfDefine SSL>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千鲤 2024-10-26 04:19:35

您是否启用了 ssl 并侦听正确的端口?

NameVirtualHost *:443
Listen 443
SSLEngine On

您应该使用 https 的默认端口 (443)
您的虚拟主机应该看起来像这样,(取消注释服务器名称部分)

 <VirtualHost *:443>
     ServerName mydomainname.com

Have you enabled ssl and listen to the right port?

NameVirtualHost *:443
Listen 443
SSLEngine On

You should use the default port for https (443)
Your virtual host should look something like this, (uncomment the servername part)

 <VirtualHost *:443>
     ServerName mydomainname.com
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文